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; }