From bdfbea066666025b6239ef0b9e4470b3380c3e16 Mon Sep 17 00:00:00 2001 From: Joel Rosdahl Date: Mon, 1 Nov 2010 22:22:08 +0100 Subject: [PATCH] Fall back to preprocessor mode when seeing a non-regular include file This makes ccache not hang when some generated source code includes lines like these: --- ccache.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ccache.c b/ccache.c index 05f8631cd..25ff2b168 100644 --- 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) -- 2.47.3