From b800af662cd1135432c835643e2736921e173998 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 3 Jun 2008 13:32:04 +0200 Subject: pvfs: use utimes() instead of utime() to get better timestamp resolution Note: that libreplace always provides utimes() metze (This used to be commit 61bad69e2d7f84e2c6d6fb82917cfa86b17f54b0) --- source4/ntvfs/posix/pvfs_open.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'source4/ntvfs/posix/pvfs_open.c') diff --git a/source4/ntvfs/posix/pvfs_open.c b/source4/ntvfs/posix/pvfs_open.c index a78d0a79c7..43203086f8 100644 --- a/source4/ntvfs/posix/pvfs_open.c +++ b/source4/ntvfs/posix/pvfs_open.c @@ -525,14 +525,14 @@ static int pvfs_handle_destructor(struct pvfs_file_handle *h) } if (h->write_time.update_on_close) { - struct utimbuf unix_times; + struct timeval tv[2]; - unix_times.actime = nt_time_to_unix(h->name->dos.access_time); - unix_times.modtime = nt_time_to_unix(h->write_time.close_time); + nttime_to_timeval(&tv[0], h->name->dos.access_time); + nttime_to_timeval(&tv[1], h->write_time.close_time); - if (unix_times.actime != 0 || unix_times.modtime != 0) { - if (utime(h->name->full_name, &unix_times) == -1) { - DEBUG(0,("pvfs_close: utime() failed '%s' - %s\n", + if (!timeval_is_zero(&tv[0]) || !timeval_is_zero(&tv[1])) { + if (utimes(h->name->full_name, tv) == -1) { + DEBUG(0,("pvfs_handle_destructor: utimes() failed '%s' - %s\n", h->name->full_name, strerror(errno))); } } -- cgit