do not fail with new POSIX 2008 utimens() glibc call (#552320)

This commit is contained in:
Ondrej Vasik 2010-01-06 13:54:29 +00:00
parent bcff4970aa
commit 880ab2fd12
2 changed files with 36 additions and 1 deletions

29
cpio-2.10-utimens.patch Normal file
View File

@ -0,0 +1,29 @@
diff -urNp cpio-2.10-orig/gnu/utimens.c cpio-2.10/gnu/utimens.c
--- cpio-2.10-orig/gnu/utimens.c 2009-02-14 19:18:01.000000000 +0100
+++ cpio-2.10/gnu/utimens.c 2010-01-06 14:43:29.000000000 +0100
@@ -122,16 +122,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

View File

@ -3,7 +3,7 @@
Summary: A GNU archiving program
Name: cpio
Version: 2.10
Release: 3%{?dist}
Release: 4%{?dist}
License: GPLv3+
Group: Applications/Archiving
URL: http://www.gnu.org/software/cpio/
@ -17,6 +17,7 @@ Patch5: cpio-2.9-dir_perm.patch
Patch6: cpio-2.9-dev_number.patch
Patch7: cpio-2.9-sys_umask.patch
Patch8: cpio-2.9.90-defaultremoteshell.patch
Patch9: cpio-2.10-utimens.patch
Requires(post): /sbin/install-info
Requires(preun): /sbin/install-info
BuildRequires: texinfo, autoconf, gettext, rmt
@ -46,6 +47,7 @@ Install cpio if you need a program to manage file archives.
%patch6 -p1 -b .dev_number
%patch7 -p1 -b .sys_umask
%patch8 -p1 -b .defaultremote
%patch9 -p1 -b .utimens
autoheader
@ -90,6 +92,10 @@ fi
%{_infodir}/*.info*
%changelog
* Wed Jan 06 2010 Ondrej Vasik <ovasik@redhat.com> 2.10-4
- do not fail with new POSIX 2008 utimens() glibc call
(#552320)
* Thu Aug 06 2009 Ondrej Vasik <ovasik@redhat.com> 2.10-3
- do process install-info only without --excludedocs(#515924)