diff options
author | Jakub Jelinek <jakub@redhat.com> | 2007-03-14 13:14:58 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2007-03-14 13:14:58 +0100 |
commit | d70d13acb5b4fa124c90a96cacaa993fa0c64283 (patch) | |
tree | dc870b1be35b275ad15eb98f9d849d5ff460ae4d /libgfortran | |
parent | 0c20e4ecc9cf4286e90d5d926e11d274eb6ffe94 (diff) | |
download | gcc-d70d13acb5b4fa124c90a96cacaa993fa0c64283.zip gcc-d70d13acb5b4fa124c90a96cacaa993fa0c64283.tar.gz gcc-d70d13acb5b4fa124c90a96cacaa993fa0c64283.tar.bz2 |
unix.c (regular_file): For ACTION_UNSPECIFIED retry with O_RDONLY even if errno is EROFS.
* io/unix.c (regular_file): For ACTION_UNSPECIFIED retry with
O_RDONLY even if errno is EROFS.
From-SVN: r122914
Diffstat (limited to 'libgfortran')
-rw-r--r-- | libgfortran/ChangeLog | 5 | ||||
-rw-r--r-- | libgfortran/io/unix.c | 6 |
2 files changed, 8 insertions, 3 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index 7f90658..1e71f1d 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,8 @@ +2007-03-14 Jakub Jelinek <jakub@redhat.com> + + * io/unix.c (regular_file): For ACTION_UNSPECIFIED retry with + O_RDONLY even if errno is EROFS. + 2007-03-09 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libgfortran/31099 diff --git a/libgfortran/io/unix.c b/libgfortran/io/unix.c index 08f32878..b58df51 100644 --- a/libgfortran/io/unix.c +++ b/libgfortran/io/unix.c @@ -1213,7 +1213,7 @@ regular_file (st_parameter_open *opp, unit_flags *flags) break; case STATUS_REPLACE: - crflag = O_CREAT | O_TRUNC; + crflag = O_CREAT | O_TRUNC; break; default: @@ -1229,14 +1229,14 @@ regular_file (st_parameter_open *opp, unit_flags *flags) mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH; fd = open (path, rwflag | crflag, mode); if (flags->action != ACTION_UNSPECIFIED) - return fd; + return fd; if (fd >= 0) { flags->action = ACTION_READWRITE; return fd; } - if (errno != EACCES) + if (errno != EACCES && errno != EROFS) return fd; /* retry for read-only access */ |