summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rwxr-xr-xcommon/tests/run-test.pl5
1 files changed, 5 insertions, 0 deletions
diff --git a/common/tests/run-test.pl b/common/tests/run-test.pl
index 5b75bff2df..bbf5f22283 100755
--- a/common/tests/run-test.pl
+++ b/common/tests/run-test.pl
@@ -222,6 +222,7 @@ sub valgrind_macro
sub timed_system
{
+ pipe READEND, WRITEEND;
my $cmd = shift;
my $pid = fork;
defined $pid or die "fork: $!,";
@@ -229,12 +230,16 @@ sub timed_system
{
# Son.
setpgrp ($$, $$);
+ close WRITEEND;
+ close STDIN;
+ open (STDIN, "<&READEND");
exec $cmd;
exit 128;
}
else
{
# Father.
+ close READEND;
eval {
local $SIG{ALRM} = sub { die "alarm\n" };
alarm $timeout;