Using a signal handler that does nothing should be
authorDuncan Sands <baldrick@free.fr>
Mon, 7 Sep 2009 05:58:25 +0000 (05:58 +0000)
committerDuncan Sands <baldrick@free.fr>
Mon, 7 Sep 2009 05:58:25 +0000 (05:58 +0000)
equivalent to SIG_IGN.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81144 91177308-0d34-0410-b5e6-96231b3b80d8

lib/System/Unix/Program.inc

index adf7390f9fb2af2ed80648a480ab47c825296104..fca92923825f01207a2b2843988aa27ca70aa545 100644 (file)
@@ -116,9 +116,6 @@ 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,10 +228,9 @@ Program::Wait(unsigned secondsToWait,
 
   // Install a timeout handler.
   if (secondsToWait) {
-    Act.sa_sigaction = 0;
-    Act.sa_handler = TimeOutHandler;
+    memset(&Act, 0, sizeof(Act));
+    Act.sa_handler = SIG_IGN;
     sigemptyset(&Act.sa_mask);
-    Act.sa_flags = 0;
     sigaction(SIGALRM, &Act, &Old);
     alarm(secondsToWait);
   }