From: Joel Rosdahl Date: Sun, 8 Jan 2012 12:29:36 +0000 (+0100) Subject: Fixup after merge: Make directory creation failure fatal X-Git-Tag: v3.2~168^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=01f0b62840259006f4bf1213568eaa6809ce29e2;p=thirdparty%2Fccache.git Fixup after merge: Make directory creation failure fatal --- diff --git a/ccache.c b/ccache.c index 89c46b9f1..3bf3ee575 100644 --- a/ccache.c +++ b/ccache.c @@ -560,9 +560,8 @@ to_cache(struct args *args) unsigned added_files = 0; if (create_parent_dirs(cached_obj) != 0) { - cc_log("Failed to create parent directories for %s: %s", - cached_obj, strerror(errno)); - failed(); + fatal("Failed to create parent directory for %s: %s", + cached_obj, strerror(errno)); } tmp_stdout = format("%s.tmp.stdout.%s", cached_obj, tmp_string()); tmp_stderr = format("%s.tmp.stderr.%s", cached_obj, tmp_string()); @@ -789,12 +788,8 @@ get_object_name_from_cpp(struct args *args, struct mdfour *hash) path_stderr = format("%s/tmp.cpp_stderr.%s", temp_dir(), tmp_string()); if (create_parent_dirs(path_stdout) != 0) { - char *parent = dirname(path_stdout); - fprintf(stderr, - "ccache: failed to create %s (%s)\n", - parent, strerror(errno)); - free(parent); - exit(1); + fatal("Failed to create parent directory for %s: %s\n", + path_stdout, strerror(errno)); } time_of_compilation = time(NULL);