From 647568294fd447483fae6ee7fa7167cade136944 Mon Sep 17 00:00:00 2001 From: "Christopher J. Morrone" <morrone2@llnl.gov> Date: Thu, 26 May 2005 00:10:24 +0000 Subject: [PATCH] Always need increment the counter over the io_thr_pipe --- src/srun/io.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/srun/io.c b/src/srun/io.c index 94139e30493..a9c63f54827 100644 --- a/src/srun/io.c +++ b/src/srun/io.c @@ -387,7 +387,6 @@ _io_thr_poll(void *job_arg) while (!_io_thr_done(job)) { nfds = _setup_pollfds(job, fds, map); - if ((rc = poll(fds, nfds, -1)) <= 0) { switch(errno) { case EINTR: @@ -414,18 +413,19 @@ _io_thr_poll(void *job_arg) } /* Check for wake-up signal from other srun pthreads */ - if ((fds[i].fd == job->io_thr_pipe[0]) - && (job->io_thr_pipe[0] >=0) - && fds[i].revents) { - char c; - int n; - debug3("I/O thread received wake-up message"); - n = read(job->io_thr_pipe[0], &c, 1); - if (n < 0) { - error("Unable to read from io_thr_pipe: %m"); - } else if (n == 0) { - close(job->io_thr_pipe[0]); - job->io_thr_pipe[0] = IO_DONE; + if (fds[i].fd == job->io_thr_pipe[0]) { + if ((job->io_thr_pipe[0] >=0) + && fds[i].revents) { + char c; + int n; + debug3("I/O thread received wake-up message"); + n = read(job->io_thr_pipe[0], &c, 1); + if (n < 0) { + error("Unable to read from io_thr_pipe: %m"); + } else if (n == 0) { + close(job->io_thr_pipe[0]); + job->io_thr_pipe[0] = IO_DONE; + } } ++i; } -- GitLab