]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Fall back to preprocessor mode when seeing a non-regular include file
authorJoel Rosdahl <joel@rosdahl.net>
Mon, 1 Nov 2010 21:22:08 +0000 (22:22 +0100)
committerJoel Rosdahl <joel@rosdahl.net>
Tue, 2 Nov 2010 06:39:43 +0000 (07:39 +0100)
This makes ccache not hang when some generated source code includes lines
like these:

ccache.c

index 05f8631cdfceeecf0c9a231ecaf3c97a95e8fa1a..25ff2b16887961d5c48ad36134b7f503d5d4c9a2 100644 (file)
--- a/ccache.c
+++ b/ccache.c
@@ -314,6 +314,11 @@ remember_include_file(char *path, size_t path_len, struct mdfour *cpp_hash)
                /* Ignore directory, typically $PWD. */
                goto ignore;
        }
+       if (!S_ISREG(st.st_mode)) {
+               /* Device, pipe, socket or other strange creature. */
+               cc_log("Non-regular include file %s", path);
+               goto failure;
+       }
 
        /* Let's hash the include file. */
        if (!(sloppiness & SLOPPY_INCLUDE_FILE_MTIME)