about summary refs log tree commit diff homepage
path: root/lib/Solver
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-08-01 04:03:05 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-08-01 04:03:05 +0000
commitaef0393cb74bbfb2b44ebae46eaa3229519209b7 (patch)
tree0926102cd609439a2b287f7cd5e398f17823a7e3 /lib/Solver
parent2de3abc33bae6f1764043304f15d0fee4943d65a (diff)
downloadklee-aef0393cb74bbfb2b44ebae46eaa3229519209b7.tar.gz
Avoid failing if waitpid fails with EINTR, patch by Vladimir Kuznetsov.
git-svn-id: https://llvm.org/svn/llvm-project/klee/trunk@77770 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Solver')
-rw-r--r--lib/Solver/Solver.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/Solver/Solver.cpp b/lib/Solver/Solver.cpp
index abff5743..abe88db7 100644
--- a/lib/Solver/Solver.cpp
+++ b/lib/Solver/Solver.cpp
@@ -28,6 +28,7 @@
 #include <map>
 #include <vector>
 
+#include <errno.h>
 #include <signal.h>
 #include <sys/wait.h>
 #include <sys/ipc.h>
@@ -611,9 +612,13 @@ static bool runAndGetCexForked(::VC vc,
     _exit(res);
   } else {
     int status;
-    int res = waitpid(pid, &status, 0);
+    pid_t res;
+
+    do {
+      res = waitpid(pid, &status, 0);
+    } while (res < 0 && errno == EINTR);
     
-    if (res<0) {
+    if (res < 0) {
       fprintf(stderr, "error: waitpid() for STP failed");
       return false;
     }