From 4496c94091f8a6bc95fc1c0868eba632fae99ba3 Mon Sep 17 00:00:00 2001 From: Pádraig Brady
Date: Wed, 6 Jul 2011 23:17:10 +0100
Subject: 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
---
tests/Makefile.am | 1 +
tests/misc/timeout-group | 58 ++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 59 insertions(+)
create mode 100755 tests/misc/timeout-group
(limited to 'tests')
diff --git a/tests/Makefile.am b/tests/Makefile.am
index f8fbd38b8..ebd1b1121 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -277,6 +277,7 @@ TESTS = \
misc/tee-dash \
misc/test-diag \
misc/timeout \
+ misc/timeout-group \
misc/timeout-parameters \
misc/tr \
misc/tr-case-class \
diff --git a/tests/misc/timeout-group b/tests/misc/timeout-group
new file mode 100755
index 000000000..0c3caa0f0
--- /dev/null
+++ b/tests/misc/timeout-group
@@ -0,0 +1,58 @@
+#!/bin/sh
+# test program group handling
+
+# Copyright (C) 2011 Free Software Foundation, Inc.
+
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see