[llvm-commits] [llvm] r86481 - /llvm/trunk/lib/System/Unix/Program.inc
Duncan Sands
baldrick at free.fr
Sun Nov 8 12:55:49 PST 2009
Author: baldrick
Date: Sun Nov 8 14:55:48 2009
New Revision: 86481
URL: http://llvm.org/viewvc/llvm-project?rev=86481&view=rev
Log:
Revert commit 81144, and add a comment. It caused bugpoint timeouts
not to work any more on linux.
Modified:
llvm/trunk/lib/System/Unix/Program.inc
Modified: llvm/trunk/lib/System/Unix/Program.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/System/Unix/Program.inc?rev=86481&r1=86480&r2=86481&view=diff
==============================================================================
--- llvm/trunk/lib/System/Unix/Program.inc (original)
+++ llvm/trunk/lib/System/Unix/Program.inc Sun Nov 8 14:55:48 2009
@@ -121,6 +121,9 @@
return false;
}
+static void TimeOutHandler(int Sig) {
+}
+
static void SetMemoryLimits (unsigned size)
{
#if HAVE_SYS_RESOURCE_H
@@ -231,11 +234,14 @@
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);
}
More information about the llvm-commits
mailing list