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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user