Commit Graph

12 Commits

Author SHA1 Message Date
Pedro F. Giffuni
af7ca7c85d usr.bin: minor spelling fixes on comments.
No functional change.
2016-05-01 16:13:05 +00:00
Baptiste Daroussin
44a94685f3 timeout(1): fix the acceptable range values for parse_signal()
Before both 0 and sys_nsig would be successfully returned by parse_signal()
although being invalid signal numbers.

PR:		Alexandre Perrin <alex@kaworu.ch>
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D3990
2015-10-24 13:47:03 +00:00
Ed Maste
b0aa0c6e1b timeout: handle zombie grandchildren
timeout previously collected only one child status with wait(2). If this
was one of the grandchildren timeout would return to sigsuspend and wait
until the timeout expired. Instead, loop for all children.

PR:		kern/197608
Reviewed by:	bapt, kib
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2015-02-15 20:10:53 +00:00
Baptiste Daroussin
ff7c6d42f3 Use the new process reaper functionality
When not using the --foreground option timeout(1) is supported to signal all
command children hierarchy, timeout(1) now acquire the reaper to ensure this
really happens and no children process can escaper from timeout(1) control
2015-01-06 23:40:39 +00:00
Baptiste Daroussin
54c2e46443 Improve compatibility with GNU timeout
According to the coreutils regression testsuite for timeout(1)
It is expect to exit with a status being:
125 in case an invalid duration or signal is passed in arguments
126 in case an invalid command is passed in arguments
127 in case the command passed in arguments does not exists.

While here document this behaviour in the man page
2014-10-28 10:33:31 +00:00
Baptiste Daroussin
f62bbc4d90 Sort properly the headers
While here space/tabs cleanup

Reviewed by:	kib
2014-07-16 13:52:05 +00:00
Baptiste Daroussin
5b8b238645 White space fixes 2014-07-16 12:09:12 +00:00
Baptiste Daroussin
86b0545ed1 Sort headers
Constify long options
Remove useless call to sigemptyset
properly check errno when waiting for a process status when a SIGCHLD is received
2014-07-16 11:41:28 +00:00
Baptiste Daroussin
565b379f4b Style(9) fix 2014-07-16 11:28:53 +00:00
Baptiste Daroussin
d8d685e828 Fix build with gcc 2014-07-16 10:37:05 +00:00
Baptiste Daroussin
8b705cd9a2 Fix indentation 2014-07-16 10:34:55 +00:00
Baptiste Daroussin
42148fc49d 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
2014-07-16 09:55:36 +00:00