]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:lib: let round_timespec() handle SAMBA_UTIME_OMIT
authorRalph Boehme <slow@samba.org>
Thu, 28 Nov 2019 15:46:27 +0000 (15:46 +0000)
committerJeremy Allison <jra@samba.org>
Fri, 6 Dec 2019 00:17:36 +0000 (00:17 +0000)
This ensures callers are not required to do the check themselves and we don't
clobber omit-timespecs in this function.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=7771

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/lib/time.c

index 94bf951f1979c78733490cc273ef2b3e31da7979..e81ecfe3f461e8c16089cd42aa7b02f258db57ae 100644 (file)
@@ -141,6 +141,10 @@ void srv_put_dos_date3(char *buf,int offset,time_t unixdate)
 
 void round_timespec(enum timestamp_set_resolution res, struct timespec *ts)
 {
+       if (is_omit_timespec(ts)) {
+               return;
+       }
+
        switch (res) {
                case TIMESTAMP_SET_SECONDS:
                        round_timespec_to_sec(ts);