Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 74431
b: refs/heads/master
c: ce3b642
h: refs/heads/master
i:
  74429: 6e0863d
  74427: 86581dc
  74423: 816cf47
  74415: 55499b8
  74399: efdc25e
  74367: d85c5fd
v: v3
  • Loading branch information
Jeff Dike authored and Linus Torvalds committed Dec 3, 2007
1 parent 75a4ddc commit 6405045
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0a765329ed656ef08915c8be4aba9031ba467ee4
refs/heads/master: ce3b642d42f36406112ab474c03d81c5941d9398
11 changes: 10 additions & 1 deletion trunk/arch/um/drivers/chan_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,16 @@ void generic_free(void *data)

int generic_console_write(int fd, const char *buf, int n)
{
sigset_t old, no_sigio;
struct termios save, new;
int err;

if (isatty(fd)) {
sigemptyset(&no_sigio);
sigaddset(&no_sigio, SIGIO);
if (sigprocmask(SIG_BLOCK, &no_sigio, &old))
goto error;

CATCH_EINTR(err = tcgetattr(fd, &save));
if (err)
goto error;
Expand All @@ -97,8 +103,11 @@ int generic_console_write(int fd, const char *buf, int n)
* Restore raw mode, in any case; we *must* ignore any error apart
* EINTR, except for debug.
*/
if (isatty(fd))
if (isatty(fd)) {
CATCH_EINTR(tcsetattr(fd, TCSAFLUSH, &save));
sigprocmask(SIG_SETMASK, &old, NULL);
}

return err;
error:
return -errno;
Expand Down

0 comments on commit 6405045

Please sign in to comment.