From: Michael Hampton Date: Mon, 9 Feb 2004 22:26:17 +0000 (+0000) Subject: * Exit the citadel client when EOF reached on input - should prevent X-Git-Tag: v7.86~5622 X-Git-Url: https://code.citadel.org/?a=commitdiff_plain;h=14f32e9c2cc98144bd3fe074b3651a40918e1527;p=citadel.git * Exit the citadel client when EOF reached on input - should prevent a process from hanging around when a telnet connection dies unexpectedly --- diff --git a/citadel/ChangeLog b/citadel/ChangeLog index 20130fbb6..45573f2d2 100644 --- a/citadel/ChangeLog +++ b/citadel/ChangeLog @@ -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 Fri Jul 10 1998 Art Cancro * Initial CVS import + diff --git a/citadel/commands.c b/citadel/commands.c index b33aeb07d..25b879907 100644 --- a/citadel/commands.c +++ b/citadel/commands.c @@ -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 diff --git a/citadel/screen.c b/citadel/screen.c index 26f0b6c8f..0822b0ce9 100644 --- a/citadel/screen.c +++ b/citadel/screen.c @@ -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; }