X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=arch%2Fum%2Fdrivers%2Fchan_user.c;h=5d50d4a44abf4879220e045b9eaecf0d48d8f9d7;hb=a6df590dd8b7644c8e298e3b13442bcd6ceeb739;hp=5d3768156c92b3a9653ac022ce6b9c1f3f486719;hpb=0e396ee43e445cb7c215a98da4e76d0ce354d9d7;p=powerpc.git diff --git a/arch/um/drivers/chan_user.c b/arch/um/drivers/chan_user.c index 5d3768156c..5d50d4a44a 100644 --- a/arch/um/drivers/chan_user.c +++ b/arch/um/drivers/chan_user.c @@ -16,12 +16,11 @@ #include "user_util.h" #include "chan_user.h" #include "user.h" -#include "helper.h" #include "os.h" #include "choose-mode.h" #include "mode.h" -int generic_console_write(int fd, const char *buf, int n, void *unused) +int generic_console_write(int fd, const char *buf, int n) { struct termios save, new; int err; @@ -63,7 +62,7 @@ error: * * SIGWINCH can't be received synchronously, so you have to set up to receive it * as a signal. That being the case, if you are going to wait for it, it is - * convenient to sit in a pause() and wait for the signal to bounce you out of + * convenient to sit in sigsuspend() and wait for the signal to bounce you out of * it (see below for how we make sure to exit only on SIGWINCH). */ @@ -94,18 +93,19 @@ static int winch_thread(void *arg) "byte, err = %d\n", -count); /* We are not using SIG_IGN on purpose, so don't fix it as I thought to - * do! If using SIG_IGN, the pause() call below would not stop on + * do! If using SIG_IGN, the sigsuspend() call below would not stop on * SIGWINCH. */ signal(SIGWINCH, winch_handler); sigfillset(&sigs); - sigdelset(&sigs, SIGWINCH); - /* Block anything else than SIGWINCH. */ + /* Block all signals possible. */ if(sigprocmask(SIG_SETMASK, &sigs, NULL) < 0){ printk("winch_thread : sigprocmask failed, errno = %d\n", errno); exit(1); } + /* In sigsuspend(), block anything else than SIGWINCH. */ + sigdelset(&sigs, SIGWINCH); if(setsid() < 0){ printk("winch_thread : setsid failed, errno = %d\n", errno); @@ -130,7 +130,7 @@ static int winch_thread(void *arg) while(1){ /* This will be interrupted by SIGWINCH only, since other signals * are blocked.*/ - pause(); + sigsuspend(&sigs); count = os_write_file(pipe_fd, &c, sizeof(c)); if(count != sizeof(c))