aboutsummaryrefslogtreecommitdiff
path: root/libgfortran/io/unix.c
diff options
context:
space:
mode:
Diffstat (limited to 'libgfortran/io/unix.c')
-rw-r--r--libgfortran/io/unix.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libgfortran/io/unix.c b/libgfortran/io/unix.c
index 08f32878fcd..b58df51ae36 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 */