// 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",
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();
}
} 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");
}
}
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
// Size of headers to ignore list.
size_t ignore_headers_len;
-// The name of the cpp stderr file.
-char* cpp_stderr;
-
// The stats file to use for the manifest.
char* manifest_stats_file;