mirror of
https://sourceware.org/git/glibc.git
synced 2025-08-05 19:35:52 +03:00
* sysdeps/mach/hurd/sigwait.c (__sigwait): Use __sigandset,
__sigisemptyset. Don't use MASK uninitialized. * sysdeps/mach/hurd/sigprocmask.c (__sigprocmask): Use __sigorset. * hurd/hurdinit.c (_hurd_new_proc_init): Use __sigisemptyset. * hurd/hurdsig.c (_hurd_internal_post_signal): Use __sigismember, __sigdelset, __sigaddset, __sigorset.
This commit is contained in:
@@ -1,5 +1,13 @@
|
|||||||
2002-01-02 Roland McGrath <roland@frob.com>
|
2002-01-02 Roland McGrath <roland@frob.com>
|
||||||
|
|
||||||
|
* sysdeps/mach/hurd/sigwait.c (__sigwait): Use __sigandset,
|
||||||
|
__sigisemptyset. Don't use MASK uninitialized.
|
||||||
|
|
||||||
|
* sysdeps/mach/hurd/sigprocmask.c (__sigprocmask): Use __sigorset.
|
||||||
|
* hurd/hurdinit.c (_hurd_new_proc_init): Use __sigisemptyset.
|
||||||
|
* hurd/hurdsig.c (_hurd_internal_post_signal): Use __sigismember,
|
||||||
|
__sigdelset, __sigaddset, __sigorset.
|
||||||
|
|
||||||
* sysdeps/generic/htonl.c: Use uint32_t instead of u_int32_t.
|
* sysdeps/generic/htonl.c: Use uint32_t instead of u_int32_t.
|
||||||
* sysdeps/generic/htons.c: Use uint16_t instead of u_int16_t.
|
* sysdeps/generic/htons.c: Use uint16_t instead of u_int16_t.
|
||||||
|
|
||||||
|
@@ -166,7 +166,7 @@ _hurd_new_proc_init (char **argv,
|
|||||||
while. Eventually it probably makes most sense for the exec server to
|
while. Eventually it probably makes most sense for the exec server to
|
||||||
mask out EXEC_SIGTRAP so the debugged program is closer to not being
|
mask out EXEC_SIGTRAP so the debugged program is closer to not being
|
||||||
able to tell it's being debugged. */
|
able to tell it's being debugged. */
|
||||||
if (_hurdsig_traced
|
if (!__sigisemptyset (&_hurdsig_traced)
|
||||||
#ifdef EXEC_SIGTRAP
|
#ifdef EXEC_SIGTRAP
|
||||||
&& !(_hurd_exec_flags & EXEC_SIGTRAP)
|
&& !(_hurd_exec_flags & EXEC_SIGTRAP)
|
||||||
#endif
|
#endif
|
||||||
|
@@ -588,7 +588,7 @@ _hurd_internal_post_signal (struct hurd_sigstate *ss,
|
|||||||
handler = ss->preemptors ? try_preemptor (ss->preemptors) : SIG_ERR;
|
handler = ss->preemptors ? try_preemptor (ss->preemptors) : SIG_ERR;
|
||||||
|
|
||||||
/* If no thread-specific preemptor, check for a global one. */
|
/* If no thread-specific preemptor, check for a global one. */
|
||||||
if (handler == SIG_ERR && (__sigmask (signo) & _hurdsig_preempted_set))
|
if (handler == SIG_ERR && __sigismember (signo, _hurdsig_preempted_set))
|
||||||
{
|
{
|
||||||
__mutex_lock (&_hurd_siglock);
|
__mutex_lock (&_hurd_siglock);
|
||||||
handler = try_preemptor (_hurdsig_preemptors);
|
handler = try_preemptor (_hurdsig_preemptors);
|
||||||
@@ -689,7 +689,7 @@ _hurd_internal_post_signal (struct hurd_sigstate *ss,
|
|||||||
if (__sigmask (signo) & STOPSIGS)
|
if (__sigmask (signo) & STOPSIGS)
|
||||||
/* Stop signals clear a pending SIGCONT even if they
|
/* Stop signals clear a pending SIGCONT even if they
|
||||||
are handled or ignored (but not if preempted). */
|
are handled or ignored (but not if preempted). */
|
||||||
ss->pending &= ~sigmask (SIGCONT);
|
__sigdelset (&ss->pending, SIGCONT);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (signo == SIGCONT)
|
if (signo == SIGCONT)
|
||||||
@@ -928,11 +928,11 @@ _hurd_internal_post_signal (struct hurd_sigstate *ss,
|
|||||||
|
|
||||||
/* Block requested signals while running the handler. */
|
/* Block requested signals while running the handler. */
|
||||||
scp->sc_mask = ss->blocked;
|
scp->sc_mask = ss->blocked;
|
||||||
ss->blocked |= ss->actions[signo].sa_mask;
|
__sigorset (&ss->blocked, &ss->blocked, &ss->actions[signo].sa_mask);
|
||||||
|
|
||||||
/* Also block SIGNO unless we're asked not to. */
|
/* Also block SIGNO unless we're asked not to. */
|
||||||
if (! (ss->actions[signo].sa_flags & (SA_RESETHAND | SA_NODEFER)))
|
if (! (ss->actions[signo].sa_flags & (SA_RESETHAND | SA_NODEFER)))
|
||||||
ss->blocked |= __sigmask (signo);
|
__sigaddset (&ss->blocked, signo);
|
||||||
|
|
||||||
/* Reset to SIG_DFL if requested. SIGILL and SIGTRAP cannot
|
/* Reset to SIG_DFL if requested. SIGILL and SIGTRAP cannot
|
||||||
be automatically reset when delivered; the system silently
|
be automatically reset when delivered; the system silently
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
/* Copyright (C) 1991, 92, 93, 94, 95, 96, 97 Free Software Foundation, Inc.
|
/* Copyright (C) 1991,92,93,94,95,96,97,2002 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@@ -49,7 +49,7 @@ __sigprocmask (how, set, oset)
|
|||||||
switch (how)
|
switch (how)
|
||||||
{
|
{
|
||||||
case SIG_BLOCK:
|
case SIG_BLOCK:
|
||||||
ss->blocked |= new;
|
__sigorset (&ss->blocked, &ss->blocked, &new);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SIG_UNBLOCK:
|
case SIG_UNBLOCK:
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
/* Copyright (C) 1996,97,2001 Free Software Foundation, Inc.
|
/* Copyright (C) 1996,97,2001,02 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@@ -68,13 +68,15 @@ __sigwait (const sigset_t *set, int *sig)
|
|||||||
if (set != NULL)
|
if (set != NULL)
|
||||||
/* Crash before locking */
|
/* Crash before locking */
|
||||||
mask = *set;
|
mask = *set;
|
||||||
|
else
|
||||||
|
__sigemptyset (&mask);
|
||||||
|
|
||||||
ss = _hurd_self_sigstate ();
|
ss = _hurd_self_sigstate ();
|
||||||
__spin_lock (&ss->lock);
|
__spin_lock (&ss->lock);
|
||||||
|
|
||||||
/* See if one of these signals is currently pending. */
|
/* See if one of these signals is currently pending. */
|
||||||
ready = ss->pending & mask;
|
__sigandset (&ready, &ss->pending, &mask);
|
||||||
if (ready)
|
if (! __sigisemptyset (&ready))
|
||||||
{
|
{
|
||||||
for (signo = 1; signo < NSIG; signo++)
|
for (signo = 1; signo < NSIG; signo++)
|
||||||
if (__sigismember (&ready, signo))
|
if (__sigismember (&ready, signo))
|
||||||
|
Reference in New Issue
Block a user