about summary refs log tree commit diff
path: root/src/libutil
diff options
context:
space:
mode:
Diffstat (limited to 'src/libutil')
-rw-r--r--src/libutil/util.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/libutil/util.cc b/src/libutil/util.cc
index 842cf3ea47b7..b188a9fc0e79 100644
--- a/src/libutil/util.cc
+++ b/src/libutil/util.cc
@@ -779,8 +779,11 @@ void Pid::kill()
     int status;
     while (waitpid(pid, &status, 0) == -1) {
         checkInterrupt();
-        if (errno != EINTR) printMsg(lvlError,
-            (SysError(format("waiting for process %1%") % pid).msg()));
+        if (errno != EINTR) {
+            printMsg(lvlError,
+                (SysError(format("waiting for process %1%") % pid).msg()));
+            break;
+        }
     }
 
     pid = -1;