Fix client to abort script execution on SIGINT
This commit is contained in:
parent
e3cee85f7c
commit
04a8ed4a20
1 changed files with 7 additions and 1 deletions
|
@ -489,8 +489,14 @@ play(int sock)
|
||||||
&& ring_putm(&inbuf, EOF_COOKIE, sizeof(EOF_COOKIE) - 1) >= 0)
|
&& ring_putm(&inbuf, EOF_COOKIE, sizeof(EOF_COOKIE) - 1) >= 0)
|
||||||
send_eof--;
|
send_eof--;
|
||||||
if (send_intr
|
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;
|
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)
|
if (n < 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue