From nobody@FreeBSD.org  Thu Mar  6 05:58:57 2008
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7824C1065670
	for <freebsd-gnats-submit@FreeBSD.org>; Thu,  6 Mar 2008 05:58:57 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 68FEE8FC27
	for <freebsd-gnats-submit@FreeBSD.org>; Thu,  6 Mar 2008 05:58:57 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.2/8.14.2) with ESMTP id m265ts56028744
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 6 Mar 2008 05:55:54 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.2/8.14.1/Submit) id m265ts1K028743;
	Thu, 6 Mar 2008 05:55:54 GMT
	(envelope-from nobody)
Message-Id: <200803060555.m265ts1K028743@www.freebsd.org>
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: ruptime does not show correct information
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         121418
>Category:       bin
>Synopsis:       [patch] ruptime(1) does not show correct information
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    antoine
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Mar 06 06:00:01 UTC 2008
>Closed-Date:    Sat Apr 26 17:42:04 UTC 2008
>Last-Modified:  Sat Apr 26 17:42:04 UTC 2008
>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:
Responsible-Changed-From-To: freebsd-bugs->antoine 
Responsible-Changed-By: antoine 
Responsible-Changed-When: Sat Mar 8 22:24:43 UTC 2008 
Responsible-Changed-Why:  
Take. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=121418 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/121418: commit references a PR
Date: Mon, 17 Mar 2008 18:31:52 +0000 (UTC)

 antoine     2008-03-17 18:31:43 UTC
 
   FreeBSD src repository
 
   Modified files:
     usr.bin/ruptime      ruptime.c 
   Log:
   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
   
   Revision  Changes    Path
   1.19      +1 -1      src/usr.bin/ruptime/ruptime.c
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: open->patched 
State-Changed-By: antoine 
State-Changed-When: Mon Mar 17 18:43:02 UTC 2008 
State-Changed-Why:  
Patched in HEAD, thanks. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=121418 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/121418: commit references a PR
Date: Sat, 26 Apr 2008 17:36:38 +0000 (UTC)

 antoine     2008-04-26 17:36:33 UTC
 
   FreeBSD src repository
 
   Modified files:        (Branch: RELENG_7)
     usr.bin/ruptime      ruptime.c 
   Log:
   MFC to RELENG_7:
     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
   
   Revision  Changes    Path
   1.18.2.1  +1 -1      src/usr.bin/ruptime/ruptime.c
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: patched->closed 
State-Changed-By: antoine 
State-Changed-When: Sat Apr 26 17:41:19 UTC 2008 
State-Changed-Why:  
Close: fix committed in HEAD and RELENG_7. 
Thanks for the report! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=121418 
>Unformatted:
