From: Andrew Tridgell Date: Sun, 31 Mar 2002 02:57:44 +0000 (+0200) Subject: cope with -o /dev/null X-Git-Tag: v1.1~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2b3560fbea9f2a379ce486146d7fc1c73457e2cc;p=thirdparty%2Fccache.git cope with -o /dev/null --- diff --git a/ccache.c b/ccache.c index 3a2767b56..265aa0c10 100644 --- a/ccache.c +++ b/ccache.c @@ -538,6 +538,13 @@ static void process_args(int argc, char **argv) output_file, input_file); #endif } + + /* cope with -o /dev/null */ + if (stat(output_file, &st) == 0 && !S_ISREG(st.st_mode)) { + cc_log("Not a regular file %s\n", output_file); + stats_update(STATS_ARGS); + failed(); + } } /* the main ccache driver function */