diff options
author | Thomas Otto <thomas.otto@pdv-fs.de> | 2020-01-25 11:02:07 +0100 |
---|---|---|
committer | Thomas Otto <thomas.otto@pdv-fs.de> | 2020-02-17 22:06:17 +0100 |
commit | ed11fcd7cf5a0a5c48f630b40c7bab35d8619691 (patch) | |
tree | 29e2afc69b701004fe7cc8dbf65c603549793c39 /src/ccache.cpp | |
parent | 7f398575ba9edc72c4c67f6ecd9a3a231c45b7ff (diff) | |
download | ccache-ed11fcd7cf5a0a5c48f630b40c7bab35d8619691.tar.gz ccache-ed11fcd7cf5a0a5c48f630b40c7bab35d8619691.tar.bz2 ccache-ed11fcd7cf5a0a5c48f630b40c7bab35d8619691.zip |
Context: move cpp_stderr and convert to std::string
Diffstat (limited to 'src/ccache.cpp')
-rw-r--r-- | src/ccache.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/ccache.cpp b/src/ccache.cpp index d7f4f60a..3388d01e 100644 --- a/src/ccache.cpp +++ b/src/ccache.cpp @@ -1222,7 +1222,7 @@ to_cache(Context& ctx, // Merge stderr from the preprocessor (if any) and stderr from the real // compiler into tmp_stderr. - if (cpp_stderr) { + if (!ctx.cpp_stderr.empty()) { char* tmp_stderr2 = format("%s.2", tmp_stderr); if (x_rename(tmp_stderr, tmp_stderr2)) { cc_log("Failed to rename %s to %s: %s", @@ -1233,9 +1233,9 @@ to_cache(Context& ctx, failed(); } - int fd_cpp_stderr = open(cpp_stderr, O_RDONLY | O_BINARY); + int fd_cpp_stderr = open(ctx.cpp_stderr.c_str(), O_RDONLY | O_BINARY); if (fd_cpp_stderr == -1) { - cc_log("Failed opening %s: %s", cpp_stderr, strerror(errno)); + cc_log("Failed opening %s: %s", ctx.cpp_stderr.c_str(), strerror(errno)); stats_update(STATS_ERROR); failed(); } @@ -1472,7 +1472,7 @@ get_result_name_from_cpp(Context& ctx, struct args* args, struct hash* hash) } else { // If we are using the CPP trick, we need to remember this stderr data and // output it just before the main stderr from the compiler pass. - cpp_stderr = path_stderr; + ctx.cpp_stderr = from_cstr(path_stderr); hash_delimiter(hash, "runsecondcpp"); hash_string(hash, "false"); } @@ -3531,7 +3531,6 @@ cc_reset() } free_and_nullify(ignore_headers); ignore_headers_len = 0; - free_and_nullify(cpp_stderr); } // Make a copy of stderr that will not be cached, so things like distcc can |