From 5d1e1dcf4b9d4d9e0308d3e7f7036b4e5191e323 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 23 Jan 2000 01:11:43 +0000 Subject: [PATCH] don't try to write errors to a dead socket --- io.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/io.c b/io.c index 9e2a4757..4fd1a138 100644 --- a/io.c +++ b/io.c @@ -112,6 +112,7 @@ static int read_timeout(int fd, char *buf, int len) continue; } + if (n == 0) { if (eof_error) { rprintf(FERROR,"unexpected EOF in read_timeout\n"); @@ -119,6 +120,9 @@ static int read_timeout(int fd, char *buf, int len) exit_cleanup(RERR_STREAMIO); } + /* this prevents us trying to write errors on a dead socket */ + io_multiplexing_out = 0; + rprintf(FERROR,"read error: %s\n", strerror(errno)); exit_cleanup(RERR_STREAMIO); } -- 2.34.1