s3:lib: add put_long_date_full_timespec()
[vlendec/samba-autobuild/.git] / source3 / lib / time.c
index 94bf951f1979c78733490cc273ef2b3e31da7979..a5882f3d8ff5db0b84f44cdf712c3c9a9ad867b4 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);
@@ -167,6 +171,18 @@ void put_long_date_timespec(enum timestamp_set_resolution res, char *p, struct t
        SBVAL(p, 0, nt);
 }
 
+void put_long_date_full_timespec(enum timestamp_set_resolution res,
+                                char *p,
+                                const struct timespec *_ts)
+{
+       struct timespec ts = *_ts;
+       NTTIME nt;
+
+       round_timespec(res, &ts);
+       nt = full_timespec_to_nt_time(&ts);
+       SBVAL(p, 0, nt);
+}
+
 void put_long_date(char *p, time_t t)
 {
        struct timespec ts;