summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2000-08-07 15:47:48 +1000
committerDamien Miller <djm@mindrot.org>2000-08-07 15:47:48 +1000
commit0f091bd1fc9724eb7c2f8df8ad333b5390b2e639 (patch)
tree12f5dfc28f70a1c4d786c1ea6c08d15ccc01446f
parent729e1f15d8ce40d67e94bf8bd142fa67acce9a96 (diff)
- (djm) Suppress error messages on channel close shutdown() failurs
works around Linux bug. Patch from Zack Weinberg <zack@wolery.cumb.org>
-rw-r--r--ChangeLog2
-rw-r--r--nchan.c9
2 files changed, 10 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 1c2ac891f..04caaafbc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
120000807 120000807
2 - (djm) Set 0755 on binaries during install. 2 - (djm) Set 0755 on binaries during install.
3 - (djm) Suppress error messages on channel close shutdown() failurs
4 works around Linux bug. Patch from Zack Weinberg <zack@wolery.cumb.org>
3 5
420000725 620000725
5 - (djm) Fix autoconf typo: HAVE_BINRESVPORT_AF -> HAVE_BINDRESVPORT_AF 7 - (djm) Fix autoconf typo: HAVE_BINRESVPORT_AF -> HAVE_BINDRESVPORT_AF
diff --git a/nchan.c b/nchan.c
index cef56497b..51c5a4cad 100644
--- a/nchan.c
+++ b/nchan.c
@@ -483,7 +483,14 @@ chan_shutdown_read(Channel *c)
483 return; 483 return;
484 debug("channel %d: close_read", c->self); 484 debug("channel %d: close_read", c->self);
485 if (c->sock != -1) { 485 if (c->sock != -1) {
486 if (shutdown(c->sock, SHUT_RD) < 0) 486 /*
487 * shutdown(sock, SHUT_READ) may return ENOTCONN if the
488 * write side has been closed already. (bug on Linux)
489 */
490 if (shutdown(c->sock, SHUT_RD) < 0
491 && (errno != ENOTCONN
492 || c->ostate == CHAN_OUTPUT_OPEN
493 || c->ostate == CHAN_OUTPUT_WAIT_DRAIN))
487 error("channel %d: chan_shutdown_read: shutdown() failed for fd%d [i%d o%d]: %.100s", 494 error("channel %d: chan_shutdown_read: shutdown() failed for fd%d [i%d o%d]: %.100s",
488 c->self, c->sock, c->istate, c->ostate, strerror(errno)); 495 c->self, c->sock, c->istate, c->ostate, strerror(errno));
489 } else { 496 } else {