From 56e72337b01216dc7cba418f040a5cc928e5fc6f Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Wed, 1 Jun 2011 11:21:15 +0930 Subject: lib/util/time.c: timeval_current_ofs_msec Several places want "milliseconds from current time", and several were simply doing "msec * 1000" which can (and does in one place) result in a usec value over 1 a million. Using a helper to do this is safer and more readable. Signed-off-by: Rusty Russell --- lib/util/time.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/util/time.h') diff --git a/lib/util/time.h b/lib/util/time.h index 3a406340f45..4e4f72f71fb 100644 --- a/lib/util/time.h +++ b/lib/util/time.h @@ -212,6 +212,11 @@ struct timeval timeval_sum(const struct timeval *tv1, */ _PUBLIC_ struct timeval timeval_current_ofs(uint32_t secs, uint32_t usecs); +/** + return a timeval milliseconds into the future +*/ +_PUBLIC_ struct timeval timeval_current_ofs_msec(uint32_t msecs); + /** compare two timeval structures. Return -1 if tv1 < tv2 -- cgit From 0204ae6229bae3573b3194c3f657c8f385c0b940 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Wed, 1 Jun 2011 11:24:51 +0930 Subject: 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 --- lib/util/time.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/util/time.h') diff --git a/lib/util/time.h b/lib/util/time.h index 4e4f72f71fb..1f7f57db777 100644 --- a/lib/util/time.h +++ b/lib/util/time.h @@ -217,6 +217,11 @@ _PUBLIC_ struct timeval timeval_current_ofs(uint32_t secs, uint32_t usecs); */ _PUBLIC_ struct timeval timeval_current_ofs_msec(uint32_t msecs); +/** + return a timeval microseconds into the future +*/ +_PUBLIC_ struct timeval timeval_current_ofs_usec(uint32_t usecs); + /** compare two timeval structures. Return -1 if tv1 < tv2 -- cgit From 74610109ac3140713140038d10df644024796907 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 10 Jun 2011 14:59:35 +0200 Subject: lib/util/time.h: fix licence/copyright Guenther --- lib/util/time.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib/util/time.h') diff --git a/lib/util/time.h b/lib/util/time.h index 1f7f57db777..6a473f6ba14 100644 --- a/lib/util/time.h +++ b/lib/util/time.h @@ -1,7 +1,12 @@ /* Unix SMB/CIFS implementation. time utility functions - + + Copyright (C) Andrew Tridgell 1992-2004 + Copyright (C) Stefan (metze) Metzmacher 2002 + Copyright (C) Jeremy Allison 2007 + Copyright (C) Andrew Bartlett 2011 + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or -- cgit From 530e4cac2e93177923080daa5ec1bac2c65d269b Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sat, 11 Jun 2011 09:49:12 +1000 Subject: s3-param Remove 'time offset' from smb.conf This strange parameter is apparently very rarely used, and it seems to me that on modern networks, if clients don't have correct clocks and DST offsets, that many other things (Kerberos) start to fail pretty quickly, and time and DST tables tend to be internet delivered anyway. Autobuild-User: Andrew Bartlett Autobuild-Date: Sat Jun 11 03:54:45 CEST 2011 on sn-devel-104 --- lib/util/time.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'lib/util/time.h') diff --git a/lib/util/time.h b/lib/util/time.h index 6a473f6ba14..204c261c1d2 100644 --- a/lib/util/time.h +++ b/lib/util/time.h @@ -300,7 +300,4 @@ struct timespec convert_time_t_to_timespec(time_t t); bool null_timespec(struct timespec ts); -/** Extra minutes to add to the normal GMT to local time conversion. */ -extern int extra_time_offset; - #endif /* _SAMBA_TIME_H_ */ -- cgit