Fix more warnings; output errors to the users.
[citadel.git] / citadel / textclient / client_chat.c
index dbe0ce900f40503e7232f89e973177648247fec0..7bf21af225e3e7ba7e618626c17bfeefa2323686 100644 (file)
@@ -108,6 +108,13 @@ void chatmode(CtdlIPC *ipc)
                tv.tv_usec = 0;
                retval = select(1, &rfds, NULL, NULL, &tv);
 
+               if (retval < 0) {
+                       color(BRIGHT_WHITE);
+                       scr_printf("Server gone Exiting chat mode\n");
+                       scr_flush();
+                       return;
+               }
+
                /* If there's data from the keyboard... */
                if (FD_ISSET(0, &rfds)) {
                        ch = scr_getc(SCR_BLOCK);