aboutsummaryrefslogtreecommitdiff
path: root/sbin/adjkerntz
diff options
context:
space:
mode:
authorEd Schouten <ed@FreeBSD.org>2012-09-01 14:45:15 +0000
committerEd Schouten <ed@FreeBSD.org>2012-09-01 14:45:15 +0000
commit902d9eafbf66c52f8513bc38f4d0c8063c0b8a03 (patch)
tree496a0b9a3b14c27d50e1ae3b28265ecf5c2023f2 /sbin/adjkerntz
parentaeb99b567a54f0ce25c0cf33eb758f15add4580c (diff)
downloadsrc-902d9eafbf66c52f8513bc38f4d0c8063c0b8a03.tar.gz
src-902d9eafbf66c52f8513bc38f4d0c8063c0b8a03.zip
Rework all non-contributed files that use `struct timezone'.
This structure is not part of POSIX. According to POSIX, gettimeofday() has the following prototype: int gettimeofday(struct timeval *restrict tp, void *restrict tzp); Also, POSIX states that gettimeofday() shall return 0 (as long as tzp is not used). Remove dead error handling code. Also use NULL for a nul-pointer instead of integer 0. While there, change all pieces of code that only use tv_sec to use time(3), as this provides less overhead.
Notes
Notes: svn path=/head/; revision=239991
Diffstat (limited to 'sbin/adjkerntz')
-rw-r--r--sbin/adjkerntz/adjkerntz.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/sbin/adjkerntz/adjkerntz.c b/sbin/adjkerntz/adjkerntz.c
index 35d8da9d6c51..c42379d71915 100644
--- a/sbin/adjkerntz/adjkerntz.c
+++ b/sbin/adjkerntz/adjkerntz.c
@@ -315,10 +315,7 @@ recalculate:
* restoring disrtcset, since we don't clean up
* anything.
*/
- if (gettimeofday(&tv, (struct timezone *)NULL)) {
- syslog(LOG_ERR, "gettimeofday: %m");
- return 1;
- }
+ (void)gettimeofday(&tv, NULL);
tv.tv_sec += diff;
stv = &tv;
}