From nobody@FreeBSD.org  Mon Jun  7 02:39:19 2010
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 AAE7B106566B
	for <freebsd-gnats-submit@FreeBSD.org>; Mon,  7 Jun 2010 02:39:19 +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 9A37E8FC13
	for <freebsd-gnats-submit@FreeBSD.org>; Mon,  7 Jun 2010 02:39:19 +0000 (UTC)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id o572dHBS020185
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 7 Jun 2010 02:39:17 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id o572dHhb020184;
	Mon, 7 Jun 2010 02:39:17 GMT
	(envelope-from nobody)
Message-Id: <201006070239.o572dHhb020184@www.freebsd.org>
Date: Mon, 7 Jun 2010 02:39:17 GMT
From: Kaoru Kusachi <tika@lsi-j.co.jp>
To: freebsd-gnats-submit@FreeBSD.org
Subject: /usrt/bin/rup problem 365 days period
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         147629
>Category:       bin
>Synopsis:       [patch] rup(1) problem 365 days period
>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:   Mon Jun 07 02:40:03 UTC 2010
>Closed-Date:    
>Last-Modified:  Fri Sep 03 21:36:49 UTC 2010
>Originator:     Kaoru Kusachi
>Release:        8.0-RELEASE
>Organization:
LSI Japan Co.,LTD.
>Environment:
FreeBSD tc500l 8.0-RELEASE-p3 FreeBSD 8.0-RELEASE-p3 #1: Fri May 28 08:30:19 JST
 2010     root@tc500l:/usr/src/sys/i386/compile/GENERIC  i386

>Description:
For the wrong view of the flag / usr / bin / rup disappear every day 365 days run on the remote machine's display.

>How-To-Repeat:
tika@tc500l$ rup mars
mars             11:31am  up            21:26,  load average: 0.03 0.03 0.03

on remote machine

tika@mars$ uptime
 11:32am  up 365 day(s), 21:27,  1 user,  load average: 0.04, 0.03, 0.03

>Fix:
*** /usr/.zfs/snapshot/20100607/src/usr.bin/rup/rup.c   Thu Oct 29 12:06:01 2009
--- rup.c       Mon Jun  7 11:15:06 2010
***************
*** 141,152 ****
        }
  
        #define updays (host_stat->curtime.tv_sec  / 86400)
!       if (host_uptime.tm_yday != 0)
                sprintf(days_buf, "%3d day%s, ", updays,
                        (updays > 1) ? "s" : "");
!       else
                days_buf[0] = '0';
! 
        if (host_uptime.tm_hour != 0)
                sprintf(hours_buf, "%2d:%02d, ",
                        host_uptime.tm_hour, host_uptime.tm_min);
--- 141,152 ----
        }
  
        #define updays (host_stat->curtime.tv_sec  / 86400)
!       if (updays != 0) {
                sprintf(days_buf, "%3d day%s, ", updays,
                        (updays > 1) ? "s" : "");
!       } else {
                days_buf[0] = '0';
!       }
        if (host_uptime.tm_hour != 0)
                sprintf(hours_buf, "%2d:%02d, ",
                        host_uptime.tm_hour, host_uptime.tm_min);


>Release-Note:
>Audit-Trail:
>Unformatted:
