From c056e660af896c7a4ab0ecd19c06073c62ef077a Mon Sep 17 00:00:00 2001
From: Moe Jette <jette1@llnl.gov>
Date: Sat, 19 Oct 2002 00:28:45 +0000
Subject: [PATCH] Added more error logging in I/O.

---
 src/srun/io.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/srun/io.c b/src/srun/io.c
index 51f89c43936..1163840f83d 100644
--- a/src/srun/io.c
+++ b/src/srun/io.c
@@ -172,7 +172,7 @@ _io_thr_poll(void *job_arg)
 				nfds++;
 			}
 
-			if (job->out[i] == IO_DONE && job->err[i] == IO_DONE)
+			if ((job->out[i] == IO_DONE) && (job->err[i] == IO_DONE))
 				eofcnt++;
 		}
 
@@ -313,10 +313,12 @@ _accept_io_stream(job_t *job, int i)
 		while ((sd = accept(job->iofd[i], &addr, (socklen_t *)&size)) < 0) {
 			if (errno == EINTR)
 				continue;
-			if ((errno == EAGAIN) || (errno == EWOULDBLOCK))
-				return;
-			if (errno == ECONNABORTED)
+			if ((errno == EAGAIN) || 
+			    (errno == ECONNABORTED) || 
+			    (errno == EWOULDBLOCK)) {
+				debug("Stream connection refused: %m");
 				return;
+			}
 			error("Unable to accept new connection: %m\n");
 		}
 
-- 
GitLab