Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 7022
b: refs/heads/master
c: ed1b58d
h: refs/heads/master
v: v3
  • Loading branch information
Bodo Stroesser authored and Linus Torvalds committed Sep 5, 2005
1 parent c528faf commit a3b1e3a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 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: 0221575903ad68debea57679b5b46575bf57afb1
refs/heads/master: ed1b58d8b53519e10a35c6a2bb49cac35f439621
11 changes: 6 additions & 5 deletions trunk/arch/um/drivers/chan_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ int generic_console_write(int fd, const char *buf, int n, void *unused)
*
* 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).
*/

Expand Down Expand Up @@ -94,18 +94,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);
Expand All @@ -130,7 +131,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))
Expand Down

0 comments on commit a3b1e3a

Please sign in to comment.