summaryrefslogtreecommitdiff
path: root/source3/modules
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2008-07-15 15:26:36 -0700
committerJeremy Allison <jra@samba.org>2008-07-15 15:26:36 -0700
commit4d1979423e6f73954ca594197634fde563ef80f5 (patch)
treee9db16c9166c480a293b2e9d8f748f1cd60080a9 /source3/modules
parent24eec914c0d5a2ff6b6e8b0ee0bc000a9af13d4f (diff)
downloadsamba-4d1979423e6f73954ca594197634fde563ef80f5.tar.gz
samba-4d1979423e6f73954ca594197634fde563ef80f5.tar.bz2
samba-4d1979423e6f73954ca594197634fde563ef80f5.zip
Fix from Volodymyr Khomenko <Volodymyr.Khomenko@exanet.com>. Make ntimes
function more like POSIX and allow NULL arg. Help vfs developers. Jeremy. (This used to be commit 613f2849ad2dc25fe2e5f8a76d69797b5b302bb9)
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;