Commit Graph

12 Commits

Author SHA1 Message Date
pfg
ca8f20faa8 usr.bin: minor spelling fixes on comments.
No functional change.
2016-05-01 16:13:05 +00:00
bapt
79d3d4c428 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
emaste
cf55e52764 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
bapt
d7969594c9 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
bapt
8dd706ab6c 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
bapt
508ee54556 Sort properly the headers
While here space/tabs cleanup

Reviewed by:	kib
2014-07-16 13:52:05 +00:00
bapt
9628fa2be5 White space fixes 2014-07-16 12:09:12 +00:00
bapt
454c984331 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
bapt
69c3c20c39 Style(9) fix 2014-07-16 11:28:53 +00:00
bapt
f80cae3e6d Fix build with gcc 2014-07-16 10:37:05 +00:00
bapt
dbe8ba01f7 Fix indentation 2014-07-16 10:34:55 +00:00
bapt
352b002169 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