aboutsummaryrefslogtreecommitdiff
path: root/lib/Support/SystemUtils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Support/SystemUtils.cpp')
-rw-r--r--lib/Support/SystemUtils.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Support/SystemUtils.cpp b/lib/Support/SystemUtils.cpp
index 354f1a3fcd..b831f4096d 100644
--- a/lib/Support/SystemUtils.cpp
+++ b/lib/Support/SystemUtils.cpp
@@ -27,6 +27,7 @@
#include <cstdlib>
#include <fstream>
#include <iostream>
+#include <signal.h>
using namespace llvm;
/// isExecutableFile - This function returns true if the filename specified
@@ -174,7 +175,8 @@ int llvm::RunProgramWithTimeout(const std::string &ProgramPath,
struct sigaction Act, Old;
Act.sa_sigaction = 0;
Act.sa_handler = TimeOutHandler;
- Act.sa_flags = SA_NOMASK;
+ sigemptyset(&Act.sa_mask);
+ Act.sa_flags = 0;
sigaction(SIGALRM, &Act, &Old);
// Set the timeout if one is set.