diff options
Diffstat (limited to 'arch/um')
-rw-r--r-- | arch/um/drivers/chan_user.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/arch/um/drivers/chan_user.c b/arch/um/drivers/chan_user.c index b88e93b3a39f..025764089ac8 100644 --- a/arch/um/drivers/chan_user.c +++ b/arch/um/drivers/chan_user.c | |||
@@ -74,10 +74,16 @@ void generic_free(void *data) | |||
74 | 74 | ||
75 | int generic_console_write(int fd, const char *buf, int n) | 75 | int generic_console_write(int fd, const char *buf, int n) |
76 | { | 76 | { |
77 | sigset_t old, no_sigio; | ||
77 | struct termios save, new; | 78 | struct termios save, new; |
78 | int err; | 79 | int err; |
79 | 80 | ||
80 | if (isatty(fd)) { | 81 | if (isatty(fd)) { |
82 | sigemptyset(&no_sigio); | ||
83 | sigaddset(&no_sigio, SIGIO); | ||
84 | if (sigprocmask(SIG_BLOCK, &no_sigio, &old)) | ||
85 | goto error; | ||
86 | |||
81 | CATCH_EINTR(err = tcgetattr(fd, &save)); | 87 | CATCH_EINTR(err = tcgetattr(fd, &save)); |
82 | if (err) | 88 | if (err) |
83 | goto error; | 89 | goto error; |
@@ -97,8 +103,11 @@ int generic_console_write(int fd, const char *buf, int n) | |||
97 | * Restore raw mode, in any case; we *must* ignore any error apart | 103 | * Restore raw mode, in any case; we *must* ignore any error apart |
98 | * EINTR, except for debug. | 104 | * EINTR, except for debug. |
99 | */ | 105 | */ |
100 | if (isatty(fd)) | 106 | if (isatty(fd)) { |
101 | CATCH_EINTR(tcsetattr(fd, TCSAFLUSH, &save)); | 107 | CATCH_EINTR(tcsetattr(fd, TCSAFLUSH, &save)); |
108 | sigprocmask(SIG_SETMASK, &old, NULL); | ||
109 | } | ||
110 | |||
102 | return err; | 111 | return err; |
103 | error: | 112 | error: |
104 | return -errno; | 113 | return -errno; |