From: Jeremy Allison Date: Tue, 15 Jul 2008 22:26:36 +0000 (-0700) Subject: Fix from Volodymyr Khomenko . Make ntimes X-Git-Tag: samba-3.3.0pre1~550^2~9 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=613f2849ad2dc25fe2e5f8a76d69797b5b302bb9;p=thirdparty%2Fsamba.git Fix from Volodymyr Khomenko . Make ntimes function more like POSIX and allow NULL arg. Help vfs developers. Jeremy. --- diff --git a/source/modules/vfs_default.c b/source/modules/vfs_default.c index 6ee677e3765..381aa185610 100644 --- a/source/modules/vfs_default.c +++ b/source/modules/vfs_default.c @@ -657,18 +657,22 @@ static int vfswrap_ntimes(vfs_handle_struct *handle, const char *path, const str START_PROFILE(syscall_ntimes); #if defined(HAVE_UTIMES) - { + if (ts != NULL) { struct timeval tv[2]; tv[0] = convert_timespec_to_timeval(ts[0]); tv[1] = convert_timespec_to_timeval(ts[1]); result = utimes(path, tv); + } else { + result = utimes(path, NULL); } #elif defined(HAVE_UTIME) - { + if (ts != NULL) { struct utimbuf times; times.actime = convert_timespec_to_time_t(ts[0]); times.modtime = convert_timespec_to_time_t(ts[1]); result = utime(path, times); + } else { + result = utime(path, NULL); } #else errno = ENOSYS;