Philip Guenther wrote:
> 
> As a general rule, programs should not use errno values as an exit status.
> 
> Compare "sleep 100000001" w/ and w/o this diff.
> 
> ok?

agreed, but why not return 1? i don't want to have to slap 2>/dev/null around
all my sleep calls now.

> 
> Index: sleep.c
> ===================================================================
> RCS file: /data/src/openbsd/src/bin/sleep/sleep.c,v
> retrieving revision 1.23
> diff -u -p -r1.23 sleep.c
> --- sleep.c   9 Oct 2015 01:37:06 -0000       1.23
> +++ sleep.c   10 Oct 2015 23:19:03 -0000
> @@ -107,7 +107,7 @@ main(int argc, char *argv[])
>  
>       if ((secs > 0) || (nsecs > 0))
>               if (nanosleep(&rqtp, NULL))
> -                     return (errno);
> +                     err(1, NULL);
>       return (0);
>  }
>  
> 

Reply via email to