diff options
| author | Duncan Sands <baldrick@free.fr> | 2009-11-08 20:55:48 +0000 |
|---|---|---|
| committer | Duncan Sands <baldrick@free.fr> | 2009-11-08 20:55:48 +0000 |
| commit | 5987b829927111762b6354e379f331a2476c7240 (patch) | |
| tree | 3650bc01120d7abadd229f890fc29a532628bc87 /lib/System/Unix/Program.inc | |
| parent | 1cd526bc4bb02aec231107278b004f5801e2af4b (diff) | |
| download | external_llvm-5987b829927111762b6354e379f331a2476c7240.zip external_llvm-5987b829927111762b6354e379f331a2476c7240.tar.gz external_llvm-5987b829927111762b6354e379f331a2476c7240.tar.bz2 | |
Revert commit 81144, and add a comment. It caused bugpoint timeouts
not to work any more on linux.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86481 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/System/Unix/Program.inc')
| -rw-r--r-- | lib/System/Unix/Program.inc | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/System/Unix/Program.inc b/lib/System/Unix/Program.inc index c52f3a88..43c3606 100644 --- a/lib/System/Unix/Program.inc +++ b/lib/System/Unix/Program.inc @@ -121,6 +121,9 @@ static bool RedirectIO(const Path *Path, int FD, std::string* ErrMsg) { return false; } +static void TimeOutHandler(int Sig) { +} + static void SetMemoryLimits (unsigned size) { #if HAVE_SYS_RESOURCE_H @@ -231,11 +234,14 @@ Program::Wait(unsigned secondsToWait, return -1; } - // Install a timeout handler. + // Install a timeout handler. The handler itself does nothing, but the simple + // fact of having a handler at all causes the wait below to return with EINTR, + // unlike if we used SIG_IGN. if (secondsToWait) { - memset(&Act, 0, sizeof(Act)); - Act.sa_handler = SIG_IGN; + Act.sa_sigaction = 0; + Act.sa_handler = TimeOutHandler; sigemptyset(&Act.sa_mask); + Act.sa_flags = 0; sigaction(SIGALRM, &Act, &Old); alarm(secondsToWait); } |
