| Summary: | minor style(9) fix for sleep | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Base System | Reporter: | Andrew Stevenson <andrew> | ||||
| Component: | bin | Assignee: | freebsd-bugs (Nobody) <bugs> | ||||
| Status: | Closed FIXED | ||||||
| Severity: | Affects Only Me | ||||||
| Priority: | Normal | ||||||
| Version: | 4.2-STABLE | ||||||
| Hardware: | Any | ||||||
| OS: | Any | ||||||
| Attachments: |
|
||||||
|
Description
Andrew Stevenson
2001-03-10 15:30:01 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 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 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 According to the master style consultant, the presence of sysexit.h in style(9) is rather a misfeature of style(9). |