]> granicus.if.org Git - shadow/commitdiff
* libmisc/copydir.c: Call utimes() after closing the file.
authornekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Sun, 7 Sep 2008 00:51:17 +0000 (00:51 +0000)
committernekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Sun, 7 Sep 2008 00:51:17 +0000 (00:51 +0000)
ChangeLog
libmisc/copydir.c

index d0fc82772c14ad7b611d506a2f5c7a871fbf79f5..0faf82c8ab1a740769c16d2b1a42a517e8570c50 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,7 @@
 
        * libmisc/copydir.c, configure.in: Check for the presence of
        st_mtim and st_mtimensec, as for st_atim and st_atimensec.
+       * libmisc/copydir.c: Call utimes() after closing the file.
 
 2008-09-07  Nicolas François  <nicolas.francois@centraliens.net>
 
index a9aec98aec2cf906c03a0c7425704d62f1627a62..951e69ace35d53ba282919f1d23a397cbc92510c 100644 (file)
@@ -566,16 +566,18 @@ static int copy_file (const char *src, const char *dst,
        if (futimes (ofd, mt) != 0) {
                return -1;
        }
-#else
-       if (utimes(dst, mt) != 0) {
-               return -1;
-       }
 #endif
 
        if (close (ofd) != 0) {
                return -1;
        }
 
+#ifndef HAVE_FUTIMES
+       if (utimes(dst, mt) != 0) {
+               return -1;
+       }
+#endif
+
        return err;
 }