]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/um/drivers/chan_user.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6
[linux-2.6-omap-h63xx.git] / arch / um / drivers / chan_user.c
index b88e93b3a39f055a5b8a4a4d72b54ae8fe3ed5ee..cfeb3f4a44afc0ef9cb6a5edf5e08d0d81ec32a1 100644 (file)
@@ -11,6 +11,7 @@
 #include <termios.h>
 #include <sys/ioctl.h>
 #include "chan_user.h"
+#include "kern_constants.h"
 #include "os.h"
 #include "um_malloc.h"
 #include "user.h"
@@ -74,10 +75,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;
@@ -97,8 +104,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;