1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-04-11 14:44:18 +02:00

(futimens): Robustify the previous patch, by checking

for known valid error numbers rather than observed invalid ones.
This commit is contained in:
Paul Eggert
2005-01-03 19:54:54 +00:00
parent 8eb95b5cc0
commit dfe280e907

View File

@@ -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);