diff options
Diffstat (limited to 'arch/um/os-Linux/sigio.c')
-rw-r--r-- | arch/um/os-Linux/sigio.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/arch/um/os-Linux/sigio.c b/arch/um/os-Linux/sigio.c index 00e9388..0d2422a 100644 --- a/arch/um/os-Linux/sigio.c +++ b/arch/um/os-Linux/sigio.c @@ -233,7 +233,7 @@ static struct pollfd *setup_initial_poll(int fd) return p; } -void write_sigio_workaround(void) +static void write_sigio_workaround(void) { unsigned long stack; struct pollfd *p; @@ -314,6 +314,18 @@ out_close1: close(l_write_sigio_fds[1]); } +void maybe_sigio_broken(int fd, int read) +{ + if(!isatty(fd)) + return; + + if((read || pty_output_sigio) && (!read || pty_close_sigio)) + return; + + write_sigio_workaround(); + add_sigio_fd(fd, read); +} + void sigio_cleanup(void) { if(write_sigio_pid != -1){ |