tar/tar-1.22-utimens.patch
2010-01-06 09:00:49 +00:00

30 lines
839 B
Diff

diff -urNp tar-1.22-orig/lib/utimens.c tar-1.22/lib/utimens.c
--- tar-1.22-orig/lib/utimens.c 2008-10-30 08:57:49.000000000 +0100
+++ tar-1.22/lib/utimens.c 2010-01-05 20:14:50.348792138 +0100
@@ -120,16 +120,17 @@ gl_futimens (int fd ATTRIBUTE_UNUSED,
}
#endif
#if HAVE_FUTIMENS
- {
- int result = futimens (fd, timespec);
+ if (0 <= fd)
+ {
+ int result = futimens (fd, timespec);
# ifdef __linux__
- /* Work around the same bug as above. */
- if (0 < result)
- errno = ENOSYS;
+ /* Work around the same bug as above. */
+ if (0 < result)
+ errno = ENOSYS;
# endif
- if (result == 0 || errno != ENOSYS)
- return result;
- }
+ if (result == 0 || errno != ENOSYS)
+ return result;
+ }
#endif
/* The platform lacks an interface to set file timestamps with