X-Git-Url: https://code.citadel.org/?p=citadel.git;a=blobdiff_plain;f=citadel%2Ftextclient%2Fcommands.c;h=e98dad3872955267bc358fa2d75392baead8b30e;hp=7e5a80e884bdad868fff4ec038f3d20213ef39da;hb=686a8267f3ad753143303673e21dfed5cb314447;hpb=5c8d4ddb559b8c0688d58f956a8edbb0d418df6b diff --git a/citadel/textclient/commands.c b/citadel/textclient/commands.c index 7e5a80e88..e98dad387 100644 --- a/citadel/textclient/commands.c +++ b/citadel/textclient/commands.c @@ -135,7 +135,7 @@ char was_a_key_pressed(void) { * in the middle of a data transfer from the server, in which case * sending a NOOP would throw the client protocol out of sync. */ - if (FD_ISSET(0, &rfds)) { + if ((retval > 0) && FD_ISSET(0, &rfds)) { set_keepalives(KA_NO); the_character = inkey(); set_keepalives(KA_YES); @@ -284,7 +284,6 @@ void set_keepalives(int s) static time_t idlet = 0; static void really_do_keepalive(void) { - int r; /* IPC response code */ time(&idlet); @@ -298,7 +297,7 @@ static void really_do_keepalive(void) { * wait for a response. */ if (keepalives_enabled == KA_YES) { - r = CtdlIPCNoop(ipc_for_signal_handlers); + CtdlIPCNoop(ipc_for_signal_handlers); if (instant_msgs > 0) { if (ok_to_interrupt == 1) { scr_printf("\r%64s\r", ""); @@ -1476,6 +1475,11 @@ void look_for_ansi(void) if (FD_ISSET(0, &rfds)) { abuf[strlen(abuf) + 1] = 0; rv = read(0, &abuf[strlen(abuf)], 1); + if (rv < 0) { + scr_printf("failed to read after select: %s", + strerror(errno)); + break; + } } } while (FD_ISSET(0, &rfds));