summaryrefslogtreecommitdiff
path: root/bin/date
diff options
context:
space:
mode:
authorSimon J. Gerraty <sjg@FreeBSD.org>2012-11-04 02:52:03 +0000
committerSimon J. Gerraty <sjg@FreeBSD.org>2012-11-04 02:52:03 +0000
commit23090366f729c56cab62de74c7a51792357e98a9 (patch)
treec511c885796e28ec571b5267e8f11f3b103d35e9 /bin/date
parent7750ad47a9a7dbc83f87158464170c8640723293 (diff)
parent22ff74b2f44234d31540b1f7fd6c91489c37cad3 (diff)
Notes
Diffstat (limited to 'bin/date')
-rw-r--r--bin/date/date.c8
-rw-r--r--bin/date/extern.h2
-rw-r--r--bin/date/netdate.c2
3 files changed, 6 insertions, 6 deletions
diff --git a/bin/date/date.c b/bin/date/date.c
index 1e9f281bc8a7..58a9afb0d0fc 100644
--- a/bin/date/date.c
+++ b/bin/date/date.c
@@ -137,7 +137,7 @@ main(int argc, char *argv[])
* If -d or -t, set the timezone or daylight savings time; this
* doesn't belong here; the kernel should not know about either.
*/
- if (set_timezone && settimeofday((struct timeval *)NULL, &tz))
+ if (set_timezone && settimeofday(NULL, &tz) != 0)
err(1, "settimeofday (timezone)");
if (!rflag && time(&tval) == -1)
@@ -273,14 +273,14 @@ setthetime(const char *fmt, const char *p, int jflag, int nflag)
/* set the time */
if (nflag || netsettime(tval)) {
utx.ut_type = OLD_TIME;
- gettimeofday(&utx.ut_tv, NULL);
+ (void)gettimeofday(&utx.ut_tv, NULL);
pututxline(&utx);
tv.tv_sec = tval;
tv.tv_usec = 0;
- if (settimeofday(&tv, (struct timezone *)NULL))
+ if (settimeofday(&tv, NULL) != 0)
err(1, "settimeofday (timeval)");
utx.ut_type = NEW_TIME;
- gettimeofday(&utx.ut_tv, NULL);
+ (void)gettimeofday(&utx.ut_tv, NULL);
pututxline(&utx);
}
diff --git a/bin/date/extern.h b/bin/date/extern.h
index 76b8d5e16105..91aeab2e07e1 100644
--- a/bin/date/extern.h
+++ b/bin/date/extern.h
@@ -30,4 +30,6 @@
* $FreeBSD$
*/
+extern int retval;
+
int netsettime(time_t);
diff --git a/bin/date/netdate.c b/bin/date/netdate.c
index b8441068eadf..b085be4db68f 100644
--- a/bin/date/netdate.c
+++ b/bin/date/netdate.c
@@ -55,8 +55,6 @@ __FBSDID("$FreeBSD$");
#define WAITACK 2 /* seconds */
#define WAITDATEACK 5 /* seconds */
-extern int retval;
-
/*
* Set the date in the machines controlled by timedaemons by communicating the
* new date to the local timedaemon. If the timedaemon is in the master state,