From 04a8ed4a20fde14c9212d9aa1829d09f6a68e2a7 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Sat, 11 Apr 2009 22:52:52 +0200 Subject: [PATCH] Fix client to abort script execution on SIGINT --- src/client/play.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/client/play.c b/src/client/play.c index da43e609..6d74382e 100644 --- a/src/client/play.c +++ b/src/client/play.c @@ -489,8 +489,14 @@ play(int sock) && ring_putm(&inbuf, EOF_COOKIE, sizeof(EOF_COOKIE) - 1) >= 0) send_eof--; if (send_intr - && ring_putm(&inbuf, INTR_COOKIE, sizeof(INTR_COOKIE) - 1) >= 0) + && ring_putm(&inbuf, INTR_COOKIE, sizeof(INTR_COOKIE) - 1) >= 0) { send_intr = 0; + if (input_fd) { + /* execute aborted, switch back to fd 0 */ + close(input_fd); + input_fd = eof_fd0 ? -1 : 0; + } + } if (n < 0) continue;