summaryrefslogtreecommitdiff
path: root/usr.bin/rup/rup.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2013-04-03 04:12:50 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2013-04-03 04:12:50 +0000
commit6296d2e27d6b1b480991f21fc6c5ae56ca1aa007 (patch)
tree788a43368d17a36a2bd26cc99214841c9bd2c903 /usr.bin/rup/rup.c
parent33e90aa45425165b3c78a977a64e25f2e1cdc875 (diff)
do not assume time_t and timeval.tv_sec are the same type
Diffstat (limited to 'usr.bin/rup/rup.c')
-rw-r--r--usr.bin/rup/rup.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.bin/rup/rup.c b/usr.bin/rup/rup.c
index f2ddb26ba67..c7d31f30b14 100644
--- a/usr.bin/rup/rup.c
+++ b/usr.bin/rup/rup.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rup.c,v 1.24 2009/10/27 23:59:43 deraadt Exp $ */
+/* $OpenBSD: rup.c,v 1.25 2013/04/03 04:12:23 deraadt Exp $ */
/*-
* Copyright (c) 1993, John Brezak
@@ -180,13 +180,15 @@ print_rup_data(char *host, statstime *host_stat)
unsigned int ups = 0, upm = 0, uph = 0, upd = 0;
struct tm *tmp_time, host_time;
char days_buf[16], hours_buf[16];
+ time_t tim;
if (printtime)
printf("%-*.*s", HOST_WIDTH-8, HOST_WIDTH-8, host);
else
printf("%-*.*s", HOST_WIDTH, HOST_WIDTH, host);
- tmp_time = localtime((time_t *)&host_stat->curtime.tv_sec);
+ tim = host_stat->curtime.tv_sec;
+ tmp_time = localtime(&tim);
host_time = *tmp_time;
host_stat->curtime.tv_sec -= host_stat->boottime.tv_sec;