Skip to content

Commit

Permalink
* sysdeps/mach/hurd/sigwait.c (__sigwait): When returning immediately,
Browse files Browse the repository at this point in the history
	check only (SS->pending & MASK) for the signal to return.
	From Jeroen Dekkers <jeroen@dekkers.cx>.

	* iconv/skeleton.c [!RESET_INPUT_BUFFER && !SAVE_RESET_STATE]:
	Use preprocessor #if conditionals instead of `if' to avoid
	warnings about divide by zero in dead code.
  • Loading branch information
Roland McGrath committed Dec 26, 2001
1 parent a5eb702 commit 362f832
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
10 changes: 10 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
2001-12-26 Roland McGrath <roland@frob.com>

* sysdeps/mach/hurd/sigwait.c (__sigwait): When returning immediately,
check only (SS->pending & MASK) for the signal to return.
From Jeroen Dekkers <jeroen@dekkers.cx>.

2001-12-22 Roland McGrath <roland@frob.com>

* iconv/skeleton.c [!RESET_INPUT_BUFFER && !SAVE_RESET_STATE]:
Use preprocessor #if conditionals instead of `if' to avoid
warnings about divide by zero in dead code.

* hurd/Versions (libc: GLIBC_2.2.5): Add _hurd_port_set,
_hurd_port_init, and __hurd_self_sigstate.

Expand Down
15 changes: 8 additions & 7 deletions sysdeps/mach/hurd/sigwait.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
/* Copyright (C) 1996,97,2001 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
Expand Down Expand Up @@ -28,7 +28,7 @@ int
__sigwait (const sigset_t *set, int *sig)
{
struct hurd_sigstate *ss;
sigset_t mask;
sigset_t mask, ready;
int signo = 0;
struct hurd_signal_preemptor preemptor;
jmp_buf buf;
Expand Down Expand Up @@ -72,20 +72,21 @@ __sigwait (const sigset_t *set, int *sig)
ss = _hurd_self_sigstate ();
__spin_lock (&ss->lock);

/* See if one of these signals is currently pending */
if (ss->pending & mask)
/* See if one of these signals is currently pending. */
ready = ss->pending & mask;
if (ready)
{
for (signo = 1; signo < NSIG; signo++)
if (__sigismember (&ss->pending, signo))
if (__sigismember (&ready, signo))
{
__sigdelset (&ss->pending, signo);
__sigdelset (&ready, signo);
goto all_done;
}
/* Huh? Where'd it go? */
abort ();
}

/* Wait for one of them to show up */
/* Wait for one of them to show up. */

if (!setjmp (buf))
{
Expand Down

0 comments on commit 362f832

Please sign in to comment.