free(path);
path = p;
if (create_dir(path) != 0) {
- cc_log("Failed to create %s", path);
+ cc_log("Failed to create %s: %s", path, strerror(errno));
failed();
}
}
}
if (stat(path, &st) != 0) {
- cc_log("Failed to stat include file %s", path);
+ cc_log("Failed to stat include file %s: %s", path, strerror(errno));
goto failure;
}
if (S_ISDIR(st.st_mode)) {
tmp_stderr2 = format("%s.tmp.stderr2.%s", cached_obj, tmp_string());
if (x_rename(tmp_stderr, tmp_stderr2)) {
- cc_log("Failed to rename %s to %s", tmp_stderr, tmp_stderr2);
+ cc_log("Failed to rename %s to %s: %s", tmp_stderr, tmp_stderr2,
+ strerror(errno));
failed();
}
fd_cpp_stderr = open(cpp_stderr, O_RDONLY | O_BINARY);
if (fd_cpp_stderr == -1) {
- cc_log("Failed opening %s", cpp_stderr);
+ cc_log("Failed opening %s: %s", cpp_stderr, strerror(errno));
failed();
}
fd_real_stderr = open(tmp_stderr2, O_RDONLY | O_BINARY);
if (fd_real_stderr == -1) {
- cc_log("Failed opening %s", tmp_stderr2);
+ cc_log("Failed opening %s: %s", tmp_stderr2, strerror(errno));
failed();
}
fd_result = open(tmp_stderr, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0666);
if (fd_result == -1) {
- cc_log("Failed opening %s", tmp_stderr);
+ cc_log("Failed opening %s: %s", tmp_stderr, strerror(errno));
failed();
}
copy_fd(fd_cpp_stderr, fd_result);
}
if (stat(tmp_stderr, &st) != 0) {
- cc_log("Failed to stat %s", tmp_stderr);
+ cc_log("Failed to stat %s: %s", tmp_stderr, strerror(errno));
stats_update(STATS_ERROR);
failed();
}
if (st.st_size > 0) {
if (move_uncompressed_file(tmp_stderr, cached_stderr,
enable_compression) != 0) {
- cc_log("Failed to move %s to %s", tmp_stderr, cached_stderr);
+ cc_log("Failed to move %s to %s: %s", tmp_stderr, cached_stderr,
+ strerror(errno));
stats_update(STATS_ERROR);
failed();
}
tmp_unlink(tmp_stderr);
}
if (move_uncompressed_file(tmp_obj, cached_obj, enable_compression) != 0) {
- cc_log("Failed to move %s to %s", tmp_obj, cached_obj);
+ cc_log("Failed to move %s to %s: %s", tmp_obj, cached_obj, strerror(errno));
stats_update(STATS_ERROR);
failed();
} else {
* size statistics.
*/
if (stat(cached_obj, &st) != 0) {
- cc_log("Failed to stat %s", strerror(errno));
+ cc_log("Failed to stat %s: %s", cached_obj, strerror(errno));
stats_update(STATS_ERROR);
failed();
}
correct i_tmpfile */
path_stdout = input_file;
if (create_empty_file(path_stderr) != 0) {
+ cc_log("Failed to create %s: %s", path_stderr, strerror(errno));
stats_update(STATS_ERROR);
- cc_log("Failed to create %s", path_stderr);
failed();
}
status = 0;
hash_delimiter(hash, "cppstderr");
if (!hash_file(hash, path_stderr)) {
- fatal("Failed to open %s", path_stderr);
+ fatal("Failed to open %s: %s", path_stderr, strerror(errno));
}
i_tmpfile = path_stdout;
hash_string(hash, i_extension);
if (stat(args->argv[0], &st) != 0) {
- cc_log("Couldn't stat the compiler (%s)", args->argv[0]);
+ cc_log("Couldn't stat compiler %s: %s", args->argv[0], strerror(errno));
stats_update(STATS_COMPILER);
failed();
}
cc_log("Object file %s just disappeared from cache", cached_obj);
stats_update(STATS_MISSING);
} else {
- cc_log("Failed to copy/link %s to %s (%s)",
+ cc_log("Failed to copy/link %s to %s: %s",
cached_obj, output_obj, strerror(errno));
stats_update(STATS_ERROR);
failed();
cc_log("Dependency file %s just disappeared from cache", output_obj);
stats_update(STATS_MISSING);
} else {
- cc_log("Failed to copy/link %s to %s (%s)",
- cached_dep, output_dep,
- strerror(errno));
+ cc_log("Failed to copy/link %s to %s: %s",
+ cached_dep, output_dep, strerror(errno));
stats_update(STATS_ERROR);
failed();
}
/* Store the dependency file in the cache. */
ret = copy_file(output_dep, cached_dep, enable_compression);
if (ret == -1) {
- cc_log("Failed to copy %s to %s", output_dep, cached_dep);
+ cc_log("Failed to copy %s to %s: %s", output_dep, cached_dep,
+ strerror(errno));
/* Continue despite the error. */
} else {
cc_log("Stored in cache: %s", cached_dep);
uncached_fd = dup(2);
if (uncached_fd == -1) {
- cc_log("dup(2) failed");
+ cc_log("dup(2) failed: %s", strerror(errno));
failed();
}
buf = format("UNCACHED_ERR_FD=%d", uncached_fd);
if (putenv(buf) == -1) {
- cc_log("putenv failed");
+ cc_log("putenv failed: %s", strerror(errno));
failed();
}
}