X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=lib%2Futimens.c;h=bdb5a25ae61856a490232eaedbd1cbfa41091a94;hb=9f46144c41dd826d3bba1456f3f73497c570e87d;hp=4df1646d74e8d8ec86a21307e4911189aa57bbe6;hpb=8d8eda4eab3d2801251daf4eb31756c3595e2fc6;p=gnulib.git diff --git a/lib/utimens.c b/lib/utimens.c index 4df1646d7..bdb5a25ae 100644 --- a/lib/utimens.c +++ b/lib/utimens.c @@ -264,19 +264,20 @@ fdutimens (char const *file, int fd, struct timespec const timespec[2]) } # endif /* HAVE_UTIMENSAT */ # if HAVE_FUTIMENS - { - result = futimens (fd, ts); + if (0 <= fd) + { + result = futimens (fd, ts); # 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 /* __linux__ */ - if (result == 0 || errno != ENOSYS) - { - utimensat_works_really = 1; - return result; - } - } + if (result == 0 || errno != ENOSYS) + { + utimensat_works_really = 1; + return result; + } + } # endif /* HAVE_FUTIMENS */ } utimensat_works_really = -1;