]> git.pond.sub.org Git - empserver/commitdiff
(play): Continue after input read error, treating it like EOF. This
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 18 Nov 2007 09:51:16 +0000 (09:51 +0000)
committerMarkus Armbruster <armbru@pond.sub.org>
Sun, 18 Nov 2007 09:51:16 +0000 (09:51 +0000)
fixes error handling when a script can be opened but not read: it
switches back to standard input.  And it handles errors on standard
input more gracefully: orderly shutdown, buffered output is still
written out.

src/client/play.c

index c3fe98e27459f839e33617203782d68d1bd9325f..2cfacb124c4a4cbbf01c8d403ae0455964ad8ddb 100644 (file)
@@ -271,7 +271,7 @@ play(int sock)
            n = recv_input(input_fd, &inbuf);
            if (n < 0) {
                perror("read stdin"); /* FIXME stdin misleading, could be execing */
-               return -1;
+               n = 0;
            }
            if (n == 0) {
                /* EOF on input */