int simulation; /* e.g. budget command */
double dolcost;
time_t curup; /* when last input was received */
- int aborted; /* interrupt cookie received? */
+ int aborted; /* interrupt cookie or EOF received? */
int eof; /* EOF (cookie or real) received? */
int recvfail; /* #recvclient() failures */
int curid; /* for pr, cur. line's id, -1 none */
* 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 or EOF indicator set,
- * or the line is "ctld", set the player's eof flag and return -1.
+ * or the line is "ctld", set the player's eof and aborted 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.
int count;
count = -1;
- while (!player->aborted && !player->eof) {
+ while (!player->aborted) {
/* Try to get a line of input */
count = io_gets(player->iop, cmd, size);
if (count >= 0) {
/* got it */
if (strcmp(cmd, "ctld") == 0)
- player->eof = 1;
+ player->aborted = player->eof = 1;
if (strcmp(cmd, "aborted") == 0)
player->aborted = 1;
journal_input(cmd);
/* Await more input */
io_input(player->iop, IO_WAIT);
if (io_error(player->iop) || io_eof(player->iop))
- player->eof = 1;
+ player->aborted = player->eof = 1;
}
- if (player->aborted || player->eof) {
+ if (player->aborted) {
player->recvfail++;
if (player->recvfail > 255) {
/*