diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2011-06-01 11:24:51 +0930 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2011-06-01 10:38:47 +0200 |
commit | 0204ae6229bae3573b3194c3f657c8f385c0b940 (patch) | |
tree | ceedf55cc2064b7780f17df62d881872b384a6b4 /source4/ntvfs | |
parent | 56e72337b01216dc7cba418f040a5cc928e5fc6f (diff) | |
download | samba-0204ae6229bae3573b3194c3f657c8f385c0b940.tar.gz samba-0204ae6229bae3573b3194c3f657c8f385c0b940.tar.bz2 samba-0204ae6229bae3573b3194c3f657c8f385c0b940.zip |
lib/util/time.c: timeval_current_ofs_usec
Several places want "microseconds from current time", and several were
simply handing "usecs" values which could be over a million.
Using a helper to do this is safer and more readable.
I didn't replace any obviously correct callers (ie. constants).
I also renamed wait_nsec in source3/lib/util_sock.c; it's actually
microseconds not nanoseconds (introduced with this code in Volker's
19b783cc Async wrapper for open_socket_out_send/recv).
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'source4/ntvfs')
-rw-r--r-- | source4/ntvfs/posix/pvfs_open.c | 2 | ||||
-rw-r--r-- | source4/ntvfs/posix/pvfs_write.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/source4/ntvfs/posix/pvfs_open.c b/source4/ntvfs/posix/pvfs_open.c index dfe2f2aa62..d56bce58f7 100644 --- a/source4/ntvfs/posix/pvfs_open.c +++ b/source4/ntvfs/posix/pvfs_open.c @@ -1174,7 +1174,7 @@ static NTSTATUS pvfs_open_setup_retry(struct ntvfs_module_context *ntvfs, *final_timeout = timeval_add(&req->statistics.request_time, pvfs->oplock_break_timeout, 0); - end_time = timeval_current_ofs(0, (pvfs->sharing_violation_delay*4)/5); + end_time = timeval_current_ofs_usec((pvfs->sharing_violation_delay*4)/5); end_time = timeval_min(final_timeout, &end_time); } else { return NT_STATUS_INTERNAL_ERROR; diff --git a/source4/ntvfs/posix/pvfs_write.c b/source4/ntvfs/posix/pvfs_write.c index fb629a87fb..892d3dd749 100644 --- a/source4/ntvfs/posix/pvfs_write.c +++ b/source4/ntvfs/posix/pvfs_write.c @@ -64,7 +64,7 @@ static void pvfs_trigger_write_time_update(struct pvfs_file_handle *h) return; } - tv = timeval_current_ofs(0, pvfs->writetime_delay); + tv = timeval_current_ofs_usec(pvfs->writetime_delay); h->write_time.update_triggered = true; h->write_time.update_on_close = true; |