1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-08-07 09:11:11 +02:00

(open_maybe_create): Handle Solaris' failure mode when

FILE is a directory.  Reported by Vin Shelton.
This commit is contained in:
Jim Meyering
1999-05-15 04:06:51 +00:00
parent 7565800a11
commit 0a25564c1c
+3 -2
View File
@@ -121,8 +121,9 @@ open_maybe_create (const char *file, int *file_created)
*file_created = 1;
/* If the open succeeded or if it failed for any reason other
than the existence of FILE, then we're done. */
if (fd != -1 || errno != EEXIST)
than the existence of FILE, then we're done. Some systems
(solaris) set errno to EINVAL when FILE is a directory. */
if (fd != -1 || (errno != EEXIST && errno != EINVAL))
break;
/* The first open failed because FILE already exists.