summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2009-08-24 12:30:05 -0700
committerJeremy Allison <jra@samba.org>2009-08-24 12:30:05 -0700
commit87d30a1968af66619dfd60f9bc7accde2ac22345 (patch)
treea9a0c9abf074e997cbceae34f121fa4a6adb1d61 /source3/lib
parente829ca560d20e02f34831680a12f3163aee76665 (diff)
downloadsamba-87d30a1968af66619dfd60f9bc7accde2ac22345.tar.gz
samba-87d30a1968af66619dfd60f9bc7accde2ac22345.tar.bz2
samba-87d30a1968af66619dfd60f9bc7accde2ac22345.zip
Second part of fix for 6529 - Offline files conflict with Vista and Office 2003.
ext4 may be able to store ns timestamps, but the only API to *set* timestamps takes usec, not nsec. Round to usec on set requests. Jeremy.
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/time.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/source3/lib/time.c b/source3/lib/time.c
index 06605cd30a..c80b59a662 100644
--- a/source3/lib/time.c
+++ b/source3/lib/time.c
@@ -479,6 +479,16 @@ void round_timespec(struct timespec *ts)
}
/****************************************************************************
+ Round a timespec to usec value.
+****************************************************************************/
+
+void round_timespec_to_usec(struct timespec *ts)
+{
+ struct timeval tv = convert_timespec_to_timeval(*ts);
+ *ts = convert_timeval_to_timespec(tv);
+}
+
+/****************************************************************************
Interprets an nt time into a unix struct timespec.
Differs from nt_time_to_unix in that an 8 byte value of 0xffffffffffffffff
will be returned as (time_t)-1, whereas nt_time_to_unix returns 0 in this case.