diff options
author | vprus <vprus@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-06-16 12:30:49 +0000 |
---|---|---|
committer | vprus <vprus@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-06-16 12:30:49 +0000 |
commit | 7d6f49d628f8d236acbd541eb7357fe24dea8ab3 (patch) | |
tree | 48d94c15d937cd8daeaa454bfbf4e4619cdad862 /libcpp/files.c | |
parent | e174638ff04a9c48151382a725c55994a8a8d558 (diff) | |
download | gcc-7d6f49d628f8d236acbd541eb7357fe24dea8ab3.tar.gz |
* cppfiles.c (open_file): Prevent the call
for stat from overwriting errno.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@125757 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libcpp/files.c')
-rw-r--r-- | libcpp/files.c | 3 |
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) |