From dfe280e907733bbbeab2983beebc8ee5a30ac5df Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 3 Jan 2005 19:54:54 +0000 Subject: (futimens): Robustify the previous patch, by checking for known valid error numbers rather than observed invalid ones. --- lib/utimens.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'lib') 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); -- cgit v1.2.3-70-g09d2