utimens (fdutimens): ignore a negative FD, per contract
authorAurelien Jarno <aurelien@aurel32.net>
Wed, 6 Jan 2010 03:27:12 +0000 (20:27 -0700)
committerIan Beckwith <ianb@erislabs.net>
Sun, 10 Jan 2010 00:22:47 +0000 (00:22 +0000)
commit88de58a96d179d45dcd84b7965f713885607a894
tree78fe03afa31b88536c9fc4adbcdb1f5f331de912
parentbfdc84327136335864c04efa37b3a59dec6359fb
utimens (fdutimens): ignore a negative FD, per contract

* lib/utimens.c (fdutimens) [HAVE_FUTIMENS]: Call futimens only
when we have a valid file descriptor.  Otherwise, using a brand
new glibc (with just-patched futimens that now fails with EBADF)
would cause this function to fail with ENOSYS.
Reported by Guillaume Ayoub in http://bugs.debian.org/563726.
See also http://bugzilla.redhat.com/552320.

Signed-off-by: Eric Blake <ebb9@byu.net>
(cherry picked from commit 41c44a66101c6c14b4e7f151247d517579760ba9)
ChangeLog
lib/utimens.c