Bug 25654

Summary: minor style(9) fix for sleep
Product: Base System Reporter: Andrew Stevenson <andrew>
Component: binAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.2-STABLE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description Andrew Stevenson 2001-03-10 15:30:01 UTC
sleep should exit with EX_USAGE if given incorrect arguments.

How-To-Repeat: 
sleep blah blah
Comment 1 Bruce Evans 2001-03-10 16:44:13 UTC
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
Comment 2 ru freebsd_committer freebsd_triage 2001-03-12 08:16:52 UTC
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
Comment 3 Bruce Evans 2001-03-12 16:54:43 UTC
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
Comment 4 Jens Schweikhardt freebsd_committer freebsd_triage 2001-08-11 09:47:36 UTC
State Changed
From-To: open->closed

According to the master style consultant, the presence of sysexit.h 
in style(9) is rather a misfeature of style(9).