diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2013-04-19 18:11:14 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2013-04-19 18:11:14 +0000 |
commit | e175cfcb6796fdb6bcb4cf966c89ab985585b0e8 (patch) | |
tree | fa95372a867c32e0e3df7bee0c3dba5ea8b2c42b /sbin | |
parent | 3bc3bb498664d16cd37dd5ab3208ae937ccb1302 (diff) |
remove comment about "make gcc happy" for variables which WERE being
used uninitialized... clean up time related variables too for 2038++
ok millert
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/ifconfig/ifconfig.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c index 8f8470a9fbf..ebd92f67a97 100644 --- a/sbin/ifconfig/ifconfig.c +++ b/sbin/ifconfig/ifconfig.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ifconfig.c,v 1.261 2013/04/03 16:28:10 deraadt Exp $ */ +/* $OpenBSD: ifconfig.c,v 1.262 2013/04/19 18:11:13 deraadt Exp $ */ /* $NetBSD: ifconfig.c,v 1.40 1997/10/01 02:19:43 enami Exp $ */ /* @@ -3945,14 +3945,8 @@ pppoe_status(void) { struct pppoediscparms parms; struct pppoeconnectionstate state; - struct timeval temp_time; - long diff_time; - unsigned long day, hour, min, sec; - - day = hour = min = sec = 0; /* XXX make gcc happy */ memset(&state, 0, sizeof(state)); - timerclear(&temp_time); strlcpy(parms.ifname, name, sizeof(parms.ifname)); if (ioctl(s, PPPOEGETPARMS, &parms)) @@ -3987,6 +3981,10 @@ pppoe_status(void) printf(" PADR retries: %d", state.padr_retry_no); if (state.state == PPPOE_STATE_SESSION) { + struct timeval temp_time; + time_t diff_time, day = 0; + unsigned int hour = 0, min = 0, sec = 0; + if (state.session_time.tv_sec != 0) { gettimeofday(&temp_time, NULL); diff_time = temp_time.tv_sec - @@ -4005,8 +4003,8 @@ pppoe_status(void) } printf(" time: "); if (day != 0) - printf("%ldd ", day); - printf("%02ld:%02ld:%02ld", hour, min, sec); + printf("%lldd ", (long long)day); + printf("%02u:%02u:%02u", hour, min, sec); } putchar('\n'); } |