* libmisc/copydir.c: Call utimes() after closing the file.

This commit is contained in:
nekral-guest 2008-09-07 00:51:17 +00:00
parent 828e9d095e
commit f91b828708
2 changed files with 7 additions and 4 deletions

View File

@ -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>

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