diff options
author | David E. O'Brien <obrien@FreeBSD.org> | 2002-03-07 22:36:56 +0000 |
---|---|---|
committer | David E. O'Brien <obrien@FreeBSD.org> | 2002-03-07 22:36:56 +0000 |
commit | 716ced0b623dbacfe9fe179c96f5caa3e4a1eb45 (patch) | |
tree | 64ddec5fa862477f4f582195ed8b82b8ccdbb609 /usr.bin/w | |
parent | 5a236bc7d7077b5f8f7fa29498532c2810d0c72b (diff) | |
download | src-test2-716ced0b623dbacfe9fe179c96f5caa3e4a1eb45.tar.gz src-test2-716ced0b623dbacfe9fe179c96f5caa3e4a1eb45.zip |
Notes
Diffstat (limited to 'usr.bin/w')
-rw-r--r-- | usr.bin/w/w.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/usr.bin/w/w.c b/usr.bin/w/w.c index 25f3aa1bd959..35bac6013c6b 100644 --- a/usr.bin/w/w.c +++ b/usr.bin/w/w.c @@ -93,7 +93,6 @@ struct utmp utmp; struct winsize ws; kvm_t *kd; time_t now; /* the current time of day */ -time_t uptime; /* time of last reboot & elapsed time since */ int ttywidth; /* width of tty */ int argwidth; /* width of tty */ int header = 1; /* true if -h flag: don't print heading */ @@ -425,7 +424,7 @@ pr_header(nowp, nusers) int nusers; { double avenrun[3]; - time_t luptime; + time_t uptime; int days, hrs, i, mins, secs; int mib[2]; size_t size; @@ -448,15 +447,15 @@ pr_header(nowp, nusers) size = sizeof(boottime); if (sysctl(mib, 2, &boottime, &size, NULL, 0) != -1 && boottime.tv_sec != 0) { - luptime = now - boottime.tv_sec; - if (luptime > 60) - luptime += 30; - days = luptime / 86400; - luptime %= 86400; - hrs = luptime / 3600; - luptime %= 3600; - mins = luptime / 60; - secs = luptime % 60; + uptime = now - boottime.tv_sec; + if (uptime > 60) + uptime += 30; + days = uptime / 86400; + uptime %= 86400; + hrs = uptime / 3600; + uptime %= 3600; + mins = uptime / 60; + secs = uptime % 60; (void)printf(" up"); if (days > 0) (void)printf(" %d day%s,", days, days > 1 ? "s" : ""); |