From f91b82870884497a422211805e90ba71d8733398 Mon Sep 17 00:00:00 2001 From: nekral-guest Date: Sun, 7 Sep 2008 00:51:17 +0000 Subject: [PATCH] * libmisc/copydir.c: Call utimes() after closing the file. --- ChangeLog | 1 + libmisc/copydir.c | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index d0fc8277..0faf82c8 100644 --- 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 diff --git a/libmisc/copydir.c b/libmisc/copydir.c index a9aec98a..951e69ac 100644 --- a/libmisc/copydir.c +++ b/libmisc/copydir.c @@ -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; }