summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/utimens.c14
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);