diff options
author | Jim Meyering <jim@meyering.net> | 1999-05-15 04:06:51 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1999-05-15 04:06:51 +0000 |
commit | 0a25564c1c17186951986c996b5ffb2ff3d3f0e3 (patch) | |
tree | 9de83b2de299136f47862f1443112155a0e0cac2 /src | |
parent | 7565800a1155104559b5c02b73afc2e3b2aeda07 (diff) | |
download | coreutils-0a25564c1c17186951986c996b5ffb2ff3d3f0e3.tar.xz |
(open_maybe_create): Handle Solaris' failure mode when
FILE is a directory. Reported by Vin Shelton.
Diffstat (limited to 'src')
-rw-r--r-- | src/touch.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/touch.c b/src/touch.c index 26f3141fb..c3f76917a 100644 --- a/src/touch.c +++ b/src/touch.c @@ -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. |