From: Paul Eggert Date: Mon, 3 Jan 2005 19:54:54 +0000 (+0000) Subject: (futimens): Robustify the previous patch, by checking X-Git-Tag: v5.3.0~60 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=dfe280e907733bbbeab2983beebc8ee5a30ac5df;p=thirdparty%2Fcoreutils.git (futimens): Robustify the previous patch, by checking for known valid error numbers rather than observed invalid ones. --- diff --git a/lib/utimens.c b/lib/utimens.c index c394977173..4448f19f47 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);