Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 16 Jul 2014 12:29:08 +0200
From:      Mateusz Guzik <mjguzik@gmail.com>
To:        Baptiste Daroussin <bapt@FreeBSD.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r268745 - in head/usr.bin: . timeout
Message-ID:  <20140716102908.GA17076@dft-labs.eu>
In-Reply-To: <201407160955.s6G9taro084054@svn.freebsd.org>
References:  <201407160955.s6G9taro084054@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Jul 16, 2014 at 09:55:36AM +0000, Baptiste Daroussin wrote:
> Author: bapt
> Date: Wed Jul 16 09:55:36 2014
> New Revision: 268745
> URL: http://svnweb.freebsd.org/changeset/base/268745
> 
> Log:
>   New BSDL timeout(1) utility compatible with GNU timeout
>   
>   it fully passes the GNU timeout regression tests, it is written in a mostly
>   portable way (only signal parsing is relying on non portable structures)
>   
>   Phabric:	D377
> 
> +static sig_atomic_t sig_chld = 0;
> +static sig_atomic_t sig_term = 0;
> +static sig_atomic_t sig_alrm = 0;
> +static sig_atomic_t sig_ign = 0;
> +

No reason to se these explicitely to 0.

> +static void
> +usage(void)
> +{
> +	fprintf(stderr, "Usage: %s [--signal sig | -s sig] [--preserve-status]"
> +	    " [--kill-after time | -k time] [--foreground] <duration> <command>"
> +	    " <arg ...>\n", getprogname());
> +

Missing newline at the begnning.

> +	exit(EX_USAGE);
> +}
> +
> +	switch(signo) {
> +	case 0:

sig 0? I doubt it is ever delivered.

> +	if (timedout && !preserve)
> +			pstat = EXIT_TIMEOUT;
> +

Bad indentation.

> +	return (pstat);
> +}
> 

-- 
Mateusz Guzik <mjguzik gmail.com>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20140716102908.GA17076>