return false;
}
+static void TimeOutHandler(int Sig) {
+}
+
static void SetMemoryLimits (unsigned size)
{
#if HAVE_SYS_RESOURCE_H
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);
}