about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/libutil/monitor-fd.hh7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/libutil/monitor-fd.hh b/src/libutil/monitor-fd.hh
index 6f7f9792c838..72d23fb6934c 100644
--- a/src/libutil/monitor-fd.hh
+++ b/src/libutil/monitor-fd.hh
@@ -24,10 +24,7 @@ public:
             struct pollfd fds[1];
             fds[0].fd = fd;
             fds[0].events = 0;
-            if (poll(fds, 1, -1) == -1) {
-                if (errno != EINTR) abort(); // can't happen
-                return; // destructor is asking us to exit
-            }
+            if (poll(fds, 1, -1) == -1) abort(); // can't happen
             assert(fds[0].revents & POLLHUP);
             /* We got POLLHUP, so send an INT signal to the main thread. */
             kill(getpid(), SIGINT);
@@ -36,7 +33,7 @@ public:
 
     ~MonitorFdHup()
     {
-        pthread_kill(thread.native_handle(), SIGINT);
+        pthread_cancel(thread.native_handle());
         thread.join();
     }
 };