]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
cppfiles.c (open_file): Prevent the call for stat from overwriting errno.
authorVladimir Prus <vladimir@codesourcery.com>
Sat, 16 Jun 2007 12:30:49 +0000 (12:30 +0000)
committerVladimir Prus <vprus@gcc.gnu.org>
Sat, 16 Jun 2007 12:30:49 +0000 (12:30 +0000)
        * cppfiles.c (open_file): Prevent the call
        for stat from overwriting errno.

From-SVN: r125757

libcpp/ChangeLog
libcpp/files.c

index 205c1dd9db176192938bd4f725e98dcdc174e4ad..7ae04d07866aa581ebaf972b47887dbb3f940c92 100644 (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>
 
        * cppfiles.c (open_file): Account for the
index b20c38e8d875347477f224b13f7b4f432018ee5f..dbd25f2720311a7eb29f93624938c8327308e10f 100644 (file)
@@ -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)