diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2005-01-03 19:54:54 +0000 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2005-01-03 19:54:54 +0000 |
commit | dfe280e907733bbbeab2983beebc8ee5a30ac5df (patch) | |
tree | 3d6f2081485e0c9b329f7a68cf44e396c1573030 | |
parent | 8eb95b5cc018eb23cd9304a1b1c824dca406eb1d (diff) | |
download | coreutils-dfe280e907733bbbeab2983beebc8ee5a30ac5df.tar.xz |
(futimens): Robustify the previous patch, by checking
for known valid error numbers rather than observed invalid ones.
-rw-r--r-- | lib/utimens.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/utimens.c b/lib/utimens.c index c39497717..4448f19f4 100644 --- a/lib/utimens.c +++ b/lib/utimens.c @@ -81,10 +81,16 @@ futimens (int fd ATTRIBUTE_UNUSED, return 0; /* On GNU/Linux without the futimes syscall and without /proc - mounted, glibc futimes fails with errno == ENOENT or ENOSYS. - Fall back on utimes in this case. */ - if (errno != ENOENT && errno != ENOSYS) - return -1; + mounted, glibc futimes fails with errno == ENOENT. Fall back + on utimes if we get a weird error number like that. */ + switch (errno) + { + case EACCES: + case EIO: + case EPERM: + case EROFS: + return -1; + } } # endif return utimes (file, t); |