diff options
author | cheloha <cheloha@openbsd.org> | 2017-12-23 20:53:07 +0000 |
---|---|---|
committer | cheloha <cheloha@openbsd.org> | 2017-12-23 20:53:07 +0000 |
commit | 1dfeccb761e64b8879aa75aad68545dbf5f49aaa (patch) | |
tree | 255962e2bb7ed0e70827949e16faf0d11d9c8e94 /games | |
parent | Use the monotonic clock for logging progress in cdio(1) and ftp(1). (diff) | |
download | wireguard-openbsd-1dfeccb761e64b8879aa75aad68545dbf5f49aaa.tar.xz wireguard-openbsd-1dfeccb761e64b8879aa75aad68545dbf5f49aaa.zip |
As we only use the .tv_sec field, simplify gettimeofday(2) -> time(3).
ok tb@ jca@
Diffstat (limited to 'games')
-rw-r--r-- | games/pom/pom.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/games/pom/pom.c b/games/pom/pom.c index 55ce415a182..b57214e9ce3 100644 --- a/games/pom/pom.c +++ b/games/pom/pom.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pom.c,v 1.25 2016/12/01 20:08:59 fcambus Exp $ */ +/* $OpenBSD: pom.c,v 1.26 2017/12/23 20:53:07 cheloha Exp $ */ /* $NetBSD: pom.c,v 1.6 1996/02/06 22:47:29 jtc Exp $ */ /* @@ -44,7 +44,6 @@ * */ -#include <sys/time.h> #include <ctype.h> #include <err.h> #include <math.h> @@ -73,8 +72,6 @@ __dead void badformat(void); int main(int argc, char *argv[]) { - struct timeval tp; - struct timezone tzp; struct tm *GMT; time_t tmpt; double days, today, tomorrow; @@ -89,11 +86,8 @@ main(int argc, char *argv[]) strftime(buf, sizeof(buf), "%a %Y %b %e %H:%M:%S (%Z)", localtime(&tmpt)); printf("%s: ", buf); - } else { - if (gettimeofday(&tp,&tzp)) - err(1, "gettimeofday"); - tmpt = tp.tv_sec; - } + } else + tmpt = time(NULL); GMT = gmtime(&tmpt); days = (GMT->tm_yday + 1) + ((GMT->tm_hour + (GMT->tm_min / 60.0) + (GMT->tm_sec / 3600.0)) / 24.0); |