=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/nchan.c,v retrieving revision 1.67 retrieving revision 1.68 diff -u -r1.67 -r1.68 --- src/usr.bin/ssh/nchan.c 2017/09/12 06:35:32 1.67 +++ src/usr.bin/ssh/nchan.c 2018/10/04 00:10:11 1.68 @@ -1,4 +1,4 @@ -/* $OpenBSD: nchan.c,v 1.67 2017/09/12 06:35:32 djm Exp $ */ +/* $OpenBSD: nchan.c,v 1.68 2018/10/04 00:10:11 djm Exp $ */ /* * Copyright (c) 1999, 2000, 2001, 2002 Markus Friedl. All rights reserved. * @@ -371,17 +371,23 @@ if (c->type == SSH_CHANNEL_LARVAL) return; /* shutdown failure is allowed if write failed already */ - debug2("channel %d: close_write", c->self); + debug2("channel %d: %s (i%d o%d sock %d wfd %d efd %d [%s])", + c->self, __func__, c->istate, c->ostate, c->sock, c->wfd, c->efd, + channel_format_extended_usage(c)); if (c->sock != -1) { - if (shutdown(c->sock, SHUT_WR) < 0) - debug2("channel %d: chan_shutdown_write: " - "shutdown() failed for fd %d: %.100s", - c->self, c->sock, strerror(errno)); + if (shutdown(c->sock, SHUT_WR) < 0) { + debug2("channel %d: %s: shutdown() failed for " + "fd %d [i%d o%d]: %.100s", c->self, __func__, + c->sock, c->istate, c->ostate, + strerror(errno)); + } } else { - if (channel_close_fd(ssh, &c->wfd) < 0) - logit("channel %d: chan_shutdown_write: " - "close() failed for fd %d: %.100s", - c->self, c->wfd, strerror(errno)); + if (channel_close_fd(ssh, &c->wfd) < 0) { + logit("channel %d: %s: close() failed for " + "fd %d [i%d o%d]: %.100s", + c->self, __func__, c->wfd, c->istate, c->ostate, + strerror(errno)); + } } } @@ -390,17 +396,22 @@ { if (c->type == SSH_CHANNEL_LARVAL) return; - debug2("channel %d: close_read", c->self); + debug2("channel %d: %s (i%d o%d sock %d wfd %d efd %d [%s])", + c->self, __func__, c->istate, c->ostate, c->sock, c->rfd, c->efd, + channel_format_extended_usage(c)); if (c->sock != -1) { - if (shutdown(c->sock, SHUT_RD) < 0) - error("channel %d: chan_shutdown_read: " - "shutdown() failed for fd %d [i%d o%d]: %.100s", - c->self, c->sock, c->istate, c->ostate, + if (shutdown(c->sock, SHUT_RD) < 0) { + error("channel %d: %s: shutdown() failed for " + "fd %d [i%d o%d]: %.100s", + c->self, __func__, c->sock, c->istate, c->ostate, strerror(errno)); + } } else { - if (channel_close_fd(ssh, &c->rfd) < 0) - logit("channel %d: chan_shutdown_read: " - "close() failed for fd %d: %.100s", - c->self, c->rfd, strerror(errno)); + if (channel_close_fd(ssh, &c->rfd) < 0) { + logit("channel %d: %s: close() failed for " + "fd %d [i%d o%d]: %.100s", + c->self, __func__, c->rfd, c->istate, c->ostate, + strerror(errno)); + } } }