Date: Thu, 6 Mar 2008 05:55:54 GMT From: Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> To: freebsd-gnats-submit@FreeBSD.org Subject: misc/121418: ruptime does not show correct information Message-ID: <200803060555.m265ts1K028743@www.freebsd.org> Resent-Message-ID: <200803060600.m26601Fu049731@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 121418 >Category: misc >Synopsis: ruptime does not show correct information >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Mar 06 06:00:01 UTC 2008 >Closed-Date: >Last-Modified: >Originator: Atsuo Ohki >Release: 7.0-Release >Organization: Univesity of Tsukuba >Environment: FreeBSD smr01 7.0-RELEASE FreeBSD 7.0-RELEASE #0: Thu Mar 6 14:39:27 JST 2008 ohki@smr01:/usr/src/sys/i386/compile/GENERIC i386 >Description: ruptime command give "no hosts in XXX", while it shoud be. >How-To-Repeat: >Fix: variable `now' is used without initialization. --- ruptime.c-ORIG 2008-03-06 14:57:39.000000000 +0900 +++ ruptime.c 2008-03-06 14:58:07.000000000 +0900 @@ -191,6 +191,7 @@ 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 @@ 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]; >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200803060555.m265ts1K028743>