]> git.mdlowis.com Git - projs/tide.git/commitdiff
fixed a bug where jobs were prematurely killed if the POLLHUP or POLLERR occurred
authorMichael D. Lowis <mike.lowis@gentex.com>
Mon, 28 Oct 2019 13:13:31 +0000 (09:13 -0400)
committerMichael D. Lowis <mike.lowis@gentex.com>
Mon, 28 Oct 2019 13:13:31 +0000 (09:13 -0400)
TODO.md
src/lib/job.c

diff --git a/TODO.md b/TODO.md
index e5534d268c3b3db21e7597979832aab6a9edacb7..ba4f6ca44f4fd9a6353ad4f14243c2a8280db4fd 100644 (file)
--- a/TODO.md
+++ b/TODO.md
@@ -5,7 +5,6 @@
 ## STAGING
 
 * tide: assert fails in mouse handling code for invalid mouse button
-* tide: filter commands don't always select the output like they should
 * tide: move looping of cursor movements into selmoveby
 * all: eliminate multiple return statements and other lint
 * tide: byrune, byword, byline functions should be hidden in buf.c
index 127b7badf63e8d25e5e0ff4217f4f0d38dae94a0..eb84210cc50a516b4f47e757791090ceb374de71 100644 (file)
@@ -23,7 +23,7 @@ static Job* JobList = NULL;
 static void pipe_read(Job* job)
 {
     struct PipeData* pipedata = job->data;
-    char buffer[16385];
+    char buffer[32769];
     errno = 0;
     long nread = read(job->fd, buffer, sizeof(buffer)-1);
     if (nread <= 0)
@@ -96,7 +96,7 @@ static void job_process(int fd, int events)
         job->readfn(job);
     if (job->writefn && (events & POLLOUT))
         job->writefn(job);
-    if ((events & (POLLHUP|POLLERR)) || (!job->readfn && !job->writefn))
+    if ((events & (POLLHUP|POLLERR) && !job->readfn) || (!job->readfn && !job->writefn))
         job_finish(job);
 }