summaryrefslogtreecommitdiffstats
path: root/llvm/lib/System/Unix
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2009-11-08 20:55:48 +0000
committerDuncan Sands <baldrick@free.fr>2009-11-08 20:55:48 +0000
commitfec62f0ef585910716a561de021692cef5102eac (patch)
treee313df721a1c2910f87efb5a927e9e48ae0070ab /llvm/lib/System/Unix
parenta837e4db6b294a1a9b0942a2403f61c06a6a91aa (diff)
downloadbcm5719-llvm-fec62f0ef585910716a561de021692cef5102eac.tar.gz
bcm5719-llvm-fec62f0ef585910716a561de021692cef5102eac.zip
Revert commit 81144, and add a comment. It caused bugpoint timeouts
not to work any more on linux. llvm-svn: 86481
Diffstat (limited to 'llvm/lib/System/Unix')
-rw-r--r--llvm/lib/System/Unix/Program.inc12
1 files changed, 9 insertions, 3 deletions
diff --git a/llvm/lib/System/Unix/Program.inc b/llvm/lib/System/Unix/Program.inc
index c52f3a88c04..43c3606d983 100644
--- a/llvm/lib/System/Unix/Program.inc
+++ b/llvm/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);
}
OpenPOWER on IntegriCloud