From 3c3912420bc1dd7dbdef4edb13ba9fef43f5d51a Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Mon, 14 Jul 2008 22:24:42 -0400 Subject: [PATCH] Change recvclient() to treat io_error() like io_eof() This is for consistency with status() and player_login(). (cherry picked from commit b7153d095ccab8b397a3eaa3326a1806a6f616fa) --- src/lib/player/recvclient.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/lib/player/recvclient.c b/src/lib/player/recvclient.c index 5757aa406..d209214a9 100644 --- a/src/lib/player/recvclient.c +++ b/src/lib/player/recvclient.c @@ -46,10 +46,10 @@ * Else receive one line and store it in CMD[SIZE]. * This may block for input, yielding the processor. Flush buffered * output when blocking, to make sure player sees the prompt. - * If the player's connection has the I/O error indicator set, or the - * line is "aborted", set the player's aborted flag and return -2. - * If the player's connection has the EOF indicator set, or the line - * is "ctld", set the player's eof flag and return -1. + * If the player's connection has the I/O error or EOF indicator set, + * or the line is "ctld", set the player's eof flag and return -1. + * If the line is "aborted", set the player's aborted flag and return + * -2. * Else return the length of the line. * Design bug: there is no way to indicate truncation of a long line. */ @@ -84,9 +84,7 @@ recvclient(char *cmd, int size) /* Await more input */ io_input(player->iop, IO_WAIT); - if (io_error(player->iop)) - player->aborted = 1; - else if (io_eof(player->iop)) + if (io_error(player->iop) || io_eof(player->iop)) player->eof = 1; } -- 2.43.0