diff options
author | Janne Blomqvist <jb@gcc.gnu.org> | 2015-03-11 23:34:22 +0200 |
---|---|---|
committer | Janne Blomqvist <jb@gcc.gnu.org> | 2015-03-11 23:34:22 +0200 |
commit | 6234b5433f65bf4d1aa1fe2485e7f77f393a860a (patch) | |
tree | 675691d7e2fb5c94061765a40741e081281af137 /libgfortran/io/unix.c | |
parent | 707550e43ef8d80a2e2213bc1f4b3af337092d2a (diff) | |
download | gcc-6234b5433f65bf4d1aa1fe2485e7f77f393a860a.zip gcc-6234b5433f65bf4d1aa1fe2485e7f77f393a860a.tar.gz gcc-6234b5433f65bf4d1aa1fe2485e7f77f393a860a.tar.bz2 |
PR 65200 Handle EPERM in addition to EACCES.
gcc/fortran ChangeLog:
2015-03-11 Janne Blomqvist <jb@gcc.gnu.org>
PR libfortran/65200
* gfortran.texi: Document behavior when opening files without
explicit ACTION= specifier.
libgfortran ChangeLog:
2015-03-11 Janne Blomqvist <jb@gcc.gnu.org>
PR libfortran/65200
* io/open.c (new_unit): Use gf_strerror rather than hardcoding
error messages for different errno values.
* io/unix.c (regular_file2): Handle EPERM in addition to EACCES.
gcc/testsuite ChangeLog:
2015-03-11 Janne Blomqvist <jb@gcc.gnu.org>
PR libfortran/65200
* gfortran.dg/open_errors.f90: Update checks for iomsg string.
* gfortran.dg/open_new_segv.f90: Fix error message pattern.
From-SVN: r221361
Diffstat (limited to 'libgfortran/io/unix.c')
-rw-r--r-- | libgfortran/io/unix.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libgfortran/io/unix.c b/libgfortran/io/unix.c index 912364b..e5fc6e1 100644 --- a/libgfortran/io/unix.c +++ b/libgfortran/io/unix.c @@ -1353,7 +1353,7 @@ regular_file2 (const char *path, st_parameter_open *opp, unit_flags *flags) flags->action = ACTION_READWRITE; return fd; } - if (errno != EACCES && errno != EROFS) + if (errno != EACCES && errno != EPERM && errno != EROFS) return fd; /* retry for read-only access */ @@ -1369,7 +1369,7 @@ regular_file2 (const char *path, st_parameter_open *opp, unit_flags *flags) return fd; /* success */ } - if (errno != EACCES && errno != ENOENT) + if (errno != EACCES && errno != EPERM && errno != ENOENT) return fd; /* failure */ /* retry for write-only access */ |