diff options
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | nchan.c | 9 |
2 files changed, 10 insertions, 1 deletions
@@ -1,5 +1,7 @@ | |||
1 | 20000807 | 1 | 20000807 |
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 | ||
4 | 20000725 | 6 | 20000725 |
5 | - (djm) Fix autoconf typo: HAVE_BINRESVPORT_AF -> HAVE_BINDRESVPORT_AF | 7 | - (djm) Fix autoconf typo: HAVE_BINRESVPORT_AF -> HAVE_BINDRESVPORT_AF |
@@ -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 { |