NetBSD Problem Report #9396

Received: (qmail 24304 invoked from network); 12 Feb 2000 03:06:05 -0000
Message-Id: <200002120305.VAA01882@mail.natinst.com>
Date: Fri, 11 Feb 2000 21:05:18 -0600
From: "Bradley R. Smith" <brad5903@pobox.com>
To: gnats-bugs@gnats.netbsd.org
Subject: /usr/bin/leave - the alarm is up to a minute late

>Number:         9396
>Category:       bin
>Synopsis:       /usr/bin/leave - the alarm is up to a minute late
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    jrf
>State:          closed
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Fri Feb 11 19:09:00 +0000 2000
>Closed-Date:    Wed Apr 02 20:09:12 +0000 2003
>Last-Modified:  Wed Apr 02 20:09:12 +0000 2003
>Originator:     Bradley R. Smith
>Release:        1.4.1
>Organization:
>Environment:
System: NetBSD teddybear.ni.com 1.4.1 NetBSD 1.4.1 (GENERIC) #1: Tue Aug 10 00:0
3:09 MEST 1999 fvdl@struis:/usr/src/sys/arch/i386/compile/GENERIC i386

>Description:
/usr/bin/leave miscalculates the time for an alarm when you give it a specific time to leave (as opposed to a delta). The alarm should sound on the minute instead of 2-61 seconds after the minute. The calculation doesn't take into account the seconds that have already passed in the current minute or the 2 second wait for the parent process to finish.
>How-To-Repeat:
/usr/bin/leave hhmm
>Fix:
Diff for leave.c to fix the problem. The first three lines are actually a fix for PR 8944.  FreeBSD has already made the same or similar fixes.
120a121,122
>               if (hours > 11)
>                       hours -= 12;
125a128
>               secs -= now % 60;  /* alarm should sound on the minute */
146a150,155
>         /* We just slept for 2 seconds so deduct 2 from the time to sleep.
>            But don't go past zero and wrap around. */
>         if (secs >= 2)
>               secs -= 2;
>         else
>               secs = 0;


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: misc-bug-people->bin-bug-people 
Responsible-Changed-By: soren 
Responsible-Changed-When: Tue Aug 6 06:39:44 PDT 2002 
Responsible-Changed-Why:  
This is a bin problem. 
Responsible-Changed-From-To: bin-bug-people->jrf 
Responsible-Changed-By: jrf 
Responsible-Changed-When: Thu Mar 13 15:58:57 PST 2003 
Responsible-Changed-Why:  
I will look into this one. 
State-Changed-From-To: open->closed 
State-Changed-By: jrf 
State-Changed-When: Wed Apr 2 12:08:40 PST 2003 
State-Changed-Why:  
christos fixed this with 1.11. 
>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.