From: Ari Johnson Date: Tue, 19 Apr 2011 05:10:20 +0000 (-0400) Subject: Make output descriptor nonblocking and shutdown when console mode gets EOF X-Git-Url: https://git.theari.com/?a=commitdiff_plain;h=6adfa1697b24c8ed581d90ef07123d6597aa72e7;p=cobramush.git Make output descriptor nonblocking and shutdown when console mode gets EOF --- diff --git a/src/bsd.c b/src/bsd.c index 69357b2..a8315ed 100644 --- a/src/bsd.c +++ b/src/bsd.c @@ -1625,6 +1625,8 @@ shutdownsock(DESC *d) clearstrings(d); shutdown(d->descriptor, 2); closesocket(d->descriptor); + if (console_mode && d->descriptor == console_input) + shutdown_flag = 1; if (d->prev) d->prev->next = d->next; else /* d was the first one! */ @@ -1667,6 +1669,8 @@ initializesock(int s, int os, char *addr, char *ip, int use_ssl d->connected = 0; d->connected_at = mudtime; make_nonblocking(s); + if (os != s) + make_nonblocking(os); d->output_prefix = 0; d->output_suffix = 0; d->output_size = 0;