summaryrefslogtreecommitdiff
path: root/source3/modules
diff options
context:
space:
mode:
Diffstat (limited to 'source3/modules')
-rw-r--r--source3/modules/vfs_default.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c
index 6ee677e376..381aa18561 100644
--- a/source3/modules/vfs_default.c
+++ b/source3/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;