Make output descriptor nonblocking and shutdown when console mode gets EOF
authorAri Johnson <ari@theari.com>
Tue, 19 Apr 2011 05:10:20 +0000 (01:10 -0400)
committerAri Johnson <ari@theari.com>
Tue, 19 Apr 2011 05:10:20 +0000 (01:10 -0400)
src/bsd.c

index 69357b2a9d7dc6401d4e7212e99798473fddf78e..a8315ed09f3ba655a8da3eb3f109fb6fc1b8d3cd 100644 (file)
--- 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;