Fix from Volodymyr Khomenko <Volodymyr.Khomenko@exanet.com>. Make ntimes
authorJeremy Allison <jra@samba.org>
Tue, 15 Jul 2008 22:26:36 +0000 (15:26 -0700)
committerJeremy Allison <jra@samba.org>
Tue, 15 Jul 2008 22:26:36 +0000 (15:26 -0700)
function more like POSIX and allow NULL arg. Help vfs developers.
Jeremy.
(This used to be commit 613f2849ad2dc25fe2e5f8a76d69797b5b302bb9)

source3/modules/vfs_default.c

index 6ee677e3765214bb74c94180a09f14d0dbee4268..381aa185610abd3fcd49f2da2265a7420ad30dea 100644 (file)
@@ -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;