timeout: add --foreground to support interactive commands
authorPádraig Brady <P@draigBrady.com>
Wed, 6 Jul 2011 22:17:10 +0000 (23:17 +0100)
committerPádraig Brady <P@draigBrady.com>
Fri, 8 Jul 2011 10:23:08 +0000 (11:23 +0100)
commit4496c94091f8a6bc95fc1c0868eba632fae99ba3
tree44e2b1a618a781abeb02a639387efcf6320abbed
parent28a7fb52bc1160ffe1acac2e4fc3fa495d021ec4
timeout: add --foreground to support interactive commands

Or more accurately, commands not started from the shell prompt,
that are interactive, or need to receive Ctrl-C etc. from the terminal.

* doc/coreutils.texi (timeout invocation): Document --foreground.
* src/timeout.c (main): Set the foreground flag and don't create
a separate group.
(cleanup): Only send a signal directly to the monitored command
when the foreground flag is set.
(usage): Describe --foreground.
* tests/misc/timeout-group: Add a new test.
* tests/Makefile.am: Reference new test.
NEWS: Mention the new option.

Reported by Shay Shimony
Analysis by Alan Curry
Fix suggested by Paul Eggert
NEWS
doc/coreutils.texi
src/timeout.c
tests/Makefile.am
tests/misc/timeout-group [new file with mode: 0755]