diff options
Diffstat (limited to 'bin/date')
-rw-r--r-- | bin/date/Makefile.depend | 20 | ||||
-rw-r--r-- | bin/date/date.c | 8 | ||||
-rw-r--r-- | bin/date/extern.h | 2 | ||||
-rw-r--r-- | bin/date/netdate.c | 2 |
4 files changed, 26 insertions, 6 deletions
diff --git a/bin/date/Makefile.depend b/bin/date/Makefile.depend new file mode 100644 index 0000000..25ca344 --- /dev/null +++ b/bin/date/Makefile.depend @@ -0,0 +1,20 @@ +# Autogenerated - do NOT edit! + +DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,} + +DEP_MACHINE := ${.PARSEFILE:E} + +DIRDEPS = \ + gnu/lib/libgcc \ + include \ + include/protocols \ + include/xlocale \ + lib/${CSU_DIR} \ + lib/libc \ + + +.include <dirdeps.mk> + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif diff --git a/bin/date/date.c b/bin/date/date.c index 1e9f281..58a9afb 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 76b8d5e..91aeab2 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 b844106..b085be4 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, |