From andrew@ugh.net.au  Sat Mar 10 07:26:21 2001
Return-Path: <andrew@ugh.net.au>
Received: from starbug.ugh.net.au (starbug.ugh.net.au [203.31.238.37])
	by hub.freebsd.org (Postfix) with ESMTP id 97CBE37B718
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 10 Mar 2001 07:26:20 -0800 (PST)
	(envelope-from andrew@ugh.net.au)
Received: by starbug.ugh.net.au (Postfix, from userid 1000)
	id 9DEBBA86A; Sun, 11 Mar 2001 02:26:20 +1100 (EST)
Message-Id: <20010310152620.9DEBBA86A@starbug.ugh.net.au>
Date: Sun, 11 Mar 2001 02:26:20 +1100 (EST)
From: andrew@ugh.net.au
Reply-To: andrew@ugh.net.au
To: FreeBSD-gnats-submit@freebsd.org
Subject: minor style(9) fix for sleep
X-Send-Pr-Version: 3.2

>Number:         25654
>Category:       bin
>Synopsis:       minor style(9) fix for sleep
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Mar 10 07:30:01 PST 2001
>Closed-Date:    Sat Aug 11 01:47:36 PDT 2001
>Last-Modified:  Sat Aug 11 01:49:26 PDT 2001
>Originator:     Andrew
>Release:        FreeBSD 4.2-STABLE i386
>Organization:
UgH!
>Environment:

	

>Description:

sleep should exit with EX_USAGE if given incorrect arguments.

>How-To-Repeat:

sleep blah blah

>Fix:


--- sleep.c.orig	Fri Oct  1 17:53:40 1999
+++ sleep.c	Sun Mar 11 01:18:25 2001
@@ -49,6 +49,7 @@
 #include <limits.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <sysexits.h>
 #include <time.h>
 #include <unistd.h>
 
@@ -132,5 +133,5 @@
 {
 
 	(void)fprintf(stderr, "usage: sleep seconds\n");
-	exit(1);
+	exit(EX_USAGE);
 }
>Release-Note:
>Audit-Trail:

From: Bruce Evans <bde@zeta.org.au>
To: andrew@ugh.net.au
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: bin/25654: minor style(9) fix for sleep
Date: Sun, 11 Mar 2001 03:44:13 +1100 (EST)

 On Sun, 11 Mar 2001 andrew@ugh.net.au wrote:
 
 > >Description:
 > 
 > sleep should exit with EX_USAGE if given incorrect arguments.
 
 sleep shouldn't exit with EX_USAGE.
 
 The bug is style(9) saying to use sysexits.h.  Correct style may be found
 in old BSD sources like sleep.c  Only 3 non-contrib'ed files in the entire
 4.4BSDLite2 /usr/src use sysexits.h.  These are rmail.c, mail.local.c and
 sccs.c.
 
 Bruce
 

From: Ruslan Ermilov <ru@FreeBSD.org>
To: Bruce Evans <bde@zeta.org.au>
Cc: bug-followup@FreeBSD.org
Subject: Re: bin/25654: minor style(9) fix for sleep
Date: Mon, 12 Mar 2001 10:16:52 +0200

 On Sat, Mar 10, 2001 at 08:50:03AM -0800, Bruce Evans wrote:
 > 
 >  On Sun, 11 Mar 2001 andrew@ugh.net.au wrote:
 >  
 >  > >Description:
 >  > 
 >  > sleep should exit with EX_USAGE if given incorrect arguments.
 >  
 >  sleep shouldn't exit with EX_USAGE.
 >  
 >  The bug is style(9) saying to use sysexits.h.  Correct style may be found
 >  in old BSD sources like sleep.c  Only 3 non-contrib'ed files in the entire
 >  4.4BSDLite2 /usr/src use sysexits.h.  These are rmail.c, mail.local.c and
 >  sccs.c.
 >  
 But POSIX does not deny this:
 
 : EXIT STATUS
 :     The following exit values shall be returned:
 :     0 The execution was successfully suspended for at least time
 :       seconds, or a SIGALRM signal was received.  See the
 :       ASYNCHRONOUS EVENTS section.
 :     >0 An error occurred.
 
 So EX_USAGE falls nicely into ``>0'' clause.
 
 
 Cheers,
 -- 
 Ruslan Ermilov		Oracle Developer/DBA,
 ru@sunbay.com		Sunbay Software AG,
 ru@FreeBSD.org		FreeBSD committer,
 +380.652.512.251	Simferopol, Ukraine
 
 http://www.FreeBSD.org	The Power To Serve
 http://www.oracle.com	Enabling The Information Age

From: Bruce Evans <bde@zeta.org.au>
To: Ruslan Ermilov <ru@FreeBSD.org>
Cc: bug-followup@FreeBSD.org
Subject: Re: bin/25654: minor style(9) fix for sleep
Date: Tue, 13 Mar 2001 03:54:43 +1100 (EST)

 On Mon, 12 Mar 2001, Ruslan Ermilov wrote:
 
 > On Sat, Mar 10, 2001 at 08:50:03AM -0800, Bruce Evans wrote:
 > >  sleep shouldn't exit with EX_USAGE.
 > >  
 > >  The bug is style(9) saying to use sysexits.h.  Correct style may be found
 > >  in old BSD sources like sleep.c  Only 3 non-contrib'ed files in the entire
 > >  4.4BSDLite2 /usr/src use sysexits.h.  These are rmail.c, mail.local.c and
 > >  sccs.c.
 > >  
 > But POSIX does not deny this:
 > 
 > : EXIT STATUS
 > :     The following exit values shall be returned:
 > :     0 The execution was successfully suspended for at least time
 > :       seconds, or a SIGALRM signal was received.  See the
 > :       ASYNCHRONOUS EVENTS section.
 > :     >0 An error occurred.
 > 
 > So EX_USAGE falls nicely into ``>0'' clause.
 
 Similarly for FreeBSD.  It is optional and not very useful since very few
 programs use it, so it shouldn't be required.
 
 Bruce
 
State-Changed-From-To: open->closed 
State-Changed-By: schweikh 
State-Changed-When: Sat Aug 11 01:47:36 PDT 2001 
State-Changed-Why:  
According to the master style consultant, the presence of sysexit.h 
in style(9) is rather a misfeature of style(9). 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=25654 
>Unformatted:
