]> git.mdlowis.com Git - projs/tide.git/commitdiff
fixed handling of hangups and errors in pipes
authorMichael D. Lowis <mike.lowis@gentex.com>
Thu, 6 Jun 2019 00:57:33 +0000 (20:57 -0400)
committerMichael D. Lowis <mike.lowis@gentex.com>
Thu, 6 Jun 2019 00:57:33 +0000 (20:57 -0400)
src/lib/job.c

index 5f4ed42551bcec4900f99131ca8343cfbd3dff90..9d082fa708982b4420850d020f3e9a3f83aff8f0 100644 (file)
@@ -81,7 +81,7 @@ static void job_process(int fd, int events) {
         job->readfn(job);
     if (job->writefn && (events & POLLOUT))
         job->writefn(job);
-    if (!job->readfn && !job->writefn)
+    if ((events & (POLLHUP|POLLERR)) || (!job->readfn && !job->writefn))
         job_finish(job);
 }