diff options
author | Ben Lindstrom <mouring@eviladmin.org> | 2001-07-18 16:01:46 +0000 |
---|---|---|
committer | Ben Lindstrom <mouring@eviladmin.org> | 2001-07-18 16:01:46 +0000 |
commit | 16d29d57e85fd84c9dc06fd803d1abeceadff14c (patch) | |
tree | 4ab48758471d33120e01e3877e2083ac0213b0c5 /nchan.c | |
parent | a3d5a4c2dbc4fa92333b76882b00e3811177eff6 (diff) |
- markus@cvs.openbsd.org 2001/07/17 21:04:58
[channels.c channels.h clientloop.c nchan.c serverloop.c]
keep track of both maxfd and the size of the malloc'ed fdsets.
update maxfd if maxfd gets closed.
Diffstat (limited to 'nchan.c')
-rw-r--r-- | nchan.c | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -23,7 +23,7 @@ | |||
23 | */ | 23 | */ |
24 | 24 | ||
25 | #include "includes.h" | 25 | #include "includes.h" |
26 | RCSID("$OpenBSD: nchan.c,v 1.30 2001/06/25 08:25:38 markus Exp $"); | 26 | RCSID("$OpenBSD: nchan.c,v 1.31 2001/07/17 21:04:57 markus Exp $"); |
27 | 27 | ||
28 | #include "ssh1.h" | 28 | #include "ssh1.h" |
29 | #include "ssh2.h" | 29 | #include "ssh2.h" |
@@ -518,11 +518,10 @@ chan_shutdown_write(Channel *c) | |||
518 | "shutdown() failed for fd%d: %.100s", | 518 | "shutdown() failed for fd%d: %.100s", |
519 | c->self, c->sock, strerror(errno)); | 519 | c->self, c->sock, strerror(errno)); |
520 | } else { | 520 | } else { |
521 | if (close(c->wfd) < 0) | 521 | if (channel_close_fd(&c->wfd) < 0) |
522 | log("channel %d: chan_shutdown_write: " | 522 | log("channel %d: chan_shutdown_write: " |
523 | "close() failed for fd%d: %.100s", | 523 | "close() failed for fd%d: %.100s", |
524 | c->self, c->wfd, strerror(errno)); | 524 | c->self, c->wfd, strerror(errno)); |
525 | c->wfd = -1; | ||
526 | } | 525 | } |
527 | } | 526 | } |
528 | static void | 527 | static void |
@@ -544,10 +543,9 @@ chan_shutdown_read(Channel *c) | |||
544 | c->self, c->sock, c->istate, c->ostate, | 543 | c->self, c->sock, c->istate, c->ostate, |
545 | strerror(errno)); | 544 | strerror(errno)); |
546 | } else { | 545 | } else { |
547 | if (close(c->rfd) < 0) | 546 | if (channel_close_fd(&c->rfd) < 0) |
548 | log("channel %d: chan_shutdown_read: " | 547 | log("channel %d: chan_shutdown_read: " |
549 | "close() failed for fd%d: %.100s", | 548 | "close() failed for fd%d: %.100s", |
550 | c->self, c->rfd, strerror(errno)); | 549 | c->self, c->rfd, strerror(errno)); |
551 | c->rfd = -1; | ||
552 | } | 550 | } |
553 | } | 551 | } |