* Exit the citadel client when EOF reached on input - should prevent
authorMichael Hampton <io_error@uncensored.citadel.org>
Mon, 9 Feb 2004 22:26:17 +0000 (22:26 +0000)
committerMichael Hampton <io_error@uncensored.citadel.org>
Mon, 9 Feb 2004 22:26:17 +0000 (22:26 +0000)
  a process from hanging around when a telnet connection dies unexpectedly

citadel/ChangeLog
citadel/commands.c
citadel/screen.c

index 20130fbb69c4aa936d05fd62099e4f43db74ade1..45573f2d215e29770438eaf4e2600081de80808c 100644 (file)
@@ -1,4 +1,8 @@
  $Log$
+ Revision 614.24  2004/02/09 22:26:17  error
+ * Exit the citadel client when EOF reached on input - should prevent
+   a process from hanging around when a telnet connection dies unexpectedly
+
  Revision 614.23  2004/02/08 05:29:34  ajc
  * Corrected various small syntax conversion problems that were keeping
    some vCards out of the LDAP directory.
@@ -5301,3 +5305,4 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
        * Initial CVS import
+
index b33aeb07dcf3aafaa7bdf03bca9e68c84a1f0356..25b879907534e293b4a8d2b2fdb6a9681b8205de 100644 (file)
@@ -493,7 +493,7 @@ int inkey(void)
                /* At this point, there's input, so fetch it.
                 * (There's a hole in the bucket...)
                 */
-               a = scr_getc(SCR_NOBLOCK);
+               a = scr_getc(SCR_BLOCK);
                if (a == 127)
                        a = 8;
                if (a > 126)
@@ -507,7 +507,7 @@ int inkey(void)
 #ifndef DISABLE_CURSES
 #if defined(HAVE_CURSES_H) || defined(HAVE_NCURSES_H)
                if (a == ERR)
-                       a = 0;
+                       logoff(NULL, 3);
 #endif
 #endif
 
index 26f0b6c8fd3e57b190565386c38a13a665a4136f..0822b0ce91cedf7828b35a547ac09e30693336df 100644 (file)
@@ -335,7 +335,8 @@ int scr_getc(int delay)
 #endif
 
        buf = '\0';
-       read (0, &buf, 1);
+       if (!read (0, &buf, 1))
+               logoff(NULL, 3);
        return buf;
 }