cppfiles.c (open_file): Prevent the call for stat from overwriting errno.

* cppfiles.c (open_file): Prevent the call
        for stat from overwriting errno.

From-SVN: r125757
This commit is contained in:
Vladimir Prus 2007-06-16 12:30:49 +00:00 committed by Vladimir Prus
parent 6b889d891d
commit 71995ede98
2 changed files with 8 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2007-06-16 Vladimir Prus <vladimir@codesourcery.com>
* cppfiles.c (open_file): Prevent the call
for stat from overwriting errno.
2007-06-09 Vladimir Prus <vladimir@codesourcery.com> 2007-06-09 Vladimir Prus <vladimir@codesourcery.com>
* cppfiles.c (open_file): Account for the * cppfiles.c (open_file): Account for the

View File

@ -239,6 +239,9 @@ open_file (_cpp_file *file)
if (stat (file->path, &file->st) == 0 if (stat (file->path, &file->st) == 0
&& S_ISDIR (file->st.st_mode)) && S_ISDIR (file->st.st_mode))
errno = ENOENT; errno = ENOENT;
else
/* The call to stat may have reset errno. */
errno = EACCESS;
} }
#endif #endif
else if (errno == ENOTDIR) else if (errno == ENOTDIR)