summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authorantoine <antoine@FreeBSD.org>2008-03-17 18:31:43 +0000
committerantoine <antoine@FreeBSD.org>2008-03-17 18:31:43 +0000
commita3e56e863557a9de54251c4a77c56bfb88a4b12d (patch)
treeb2c0df48168cdeb0dd0c30b81562ef0a320deba8 /usr.bin
parenta52d65bf2b2e6dda6ff079c1e1f5db40b1373f7f (diff)
downloadFreeBSD-src-a3e56e863557a9de54251c4a77c56bfb88a4b12d.zip
FreeBSD-src-a3e56e863557a9de54251c4a77c56bfb88a4b12d.tar.gz
Initialize variable "now" before using it (it is used by the LEFTEARTH
macro) PR: 121418 Submitted by: Atsuo Ohki Approved by: rwatson (mentor) MFC after: 1 month
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/ruptime/ruptime.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.bin/ruptime/ruptime.c b/usr.bin/ruptime/ruptime.c
index f0778ea..1e3356f 100644
--- a/usr.bin/ruptime/ruptime.c
+++ b/usr.bin/ruptime/ruptime.c
@@ -191,6 +191,7 @@ ruptime(const char *host, int aflg, int (*cmp)(const void *, const void *))
rewinddir(dirp);
hsp = NULL;
maxloadav = -1;
+ (void)time(&now);
for (nhosts = hspace = 0; (dp = readdir(dirp)) != NULL;) {
if (dp->d_ino == 0 || strncmp(dp->d_name, "whod.", 5) != 0)
continue;
@@ -239,7 +240,6 @@ ruptime(const char *host, int aflg, int (*cmp)(const void *, const void *))
warnx("host %s not in %s", host, _PATH_RWHODIR);
}
- (void)time(&now);
qsort(hs, nhosts, sizeof(hs[0]), cmp);
for (i = 0; i < (int)nhosts; i++) {
hsp = &hs[i];
OpenPOWER on IntegriCloud