summaryrefslogtreecommitdiff
path: root/libcpp/files.c
diff options
context:
space:
mode:
Diffstat (limited to 'libcpp/files.c')
-rw-r--r--libcpp/files.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libcpp/files.c b/libcpp/files.c
index b20c38e8d87..dbd25f27203 100644
--- a/libcpp/files.c
+++ b/libcpp/files.c
@@ -239,6 +239,9 @@ open_file (_cpp_file *file)
if (stat (file->path, &file->st) == 0
&& S_ISDIR (file->st.st_mode))
errno = ENOENT;
+ else
+ /* The call to stat may have reset errno. */
+ errno = EACCESS;
}
#endif
else if (errno == ENOTDIR)