From: Michael D. Lowis Date: Mon, 28 Oct 2019 13:13:31 +0000 (-0400) Subject: fixed a bug where jobs were prematurely killed if the POLLHUP or POLLERR occurred X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=620f3a5348dcdf161c8b2ff93b0e877cf3402bb6;p=projs%2Ftide.git fixed a bug where jobs were prematurely killed if the POLLHUP or POLLERR occurred --- diff --git a/TODO.md b/TODO.md index e5534d2..ba4f6ca 100644 --- 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 diff --git a/src/lib/job.c b/src/lib/job.c index 127b7ba..eb84210 100644 --- a/src/lib/job.c +++ b/src/lib/job.c @@ -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); }