mirror of
https://sourceware.org/git/glibc.git
synced 2025-01-09 19:00:08 +00:00
(sigaction): Handle NULL argument.
1998-08-08 11:18 H.J. Lu <hjl@gnu.org> * signals.c (sigaction): Handle NULL argument.
This commit is contained in:
parent
88187dcc62
commit
cf0fd0161c
@ -1,3 +1,7 @@
|
|||||||
|
1998-08-08 11:18 H.J. Lu <hjl@gnu.org>
|
||||||
|
|
||||||
|
* signals.c (sigaction): Handle NULL argument.
|
||||||
|
|
||||||
1998-08-04 Ulrich Drepper <drepper@cygnus.com>
|
1998-08-04 Ulrich Drepper <drepper@cygnus.com>
|
||||||
|
|
||||||
* sysdeps/unix/sysv/linux/bits/sigthread.h: Use __sigset_t instead
|
* sysdeps/unix/sysv/linux/bits/sigthread.h: Use __sigset_t instead
|
||||||
|
@ -93,16 +93,24 @@ int sigaction(int sig, const struct sigaction * act,
|
|||||||
struct sigaction * oact)
|
struct sigaction * oact)
|
||||||
{
|
{
|
||||||
struct sigaction newact;
|
struct sigaction newact;
|
||||||
|
struct sigaction *newactp;
|
||||||
|
|
||||||
if (sig == __pthread_sig_restart || sig == __pthread_sig_cancel)
|
if (sig == __pthread_sig_restart || sig == __pthread_sig_cancel)
|
||||||
return EINVAL;
|
return EINVAL;
|
||||||
newact = *act;
|
if (act)
|
||||||
if (act->sa_handler != SIG_IGN && act->sa_handler != SIG_DFL)
|
{
|
||||||
newact.sa_handler = pthread_sighandler;
|
newact = *act;
|
||||||
if (__sigaction(sig, &newact, oact) == -1)
|
if (act->sa_handler != SIG_IGN && act->sa_handler != SIG_DFL)
|
||||||
|
newact.sa_handler = pthread_sighandler;
|
||||||
|
newactp = &newact;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
newactp = NULL;
|
||||||
|
if (__sigaction(sig, newactp, oact) == -1)
|
||||||
return -1;
|
return -1;
|
||||||
if (oact != NULL) oact->sa_handler = sighandler[sig];
|
if (oact != NULL) oact->sa_handler = sighandler[sig];
|
||||||
sighandler[sig] = act->sa_handler;
|
if (act)
|
||||||
|
sighandler[sig] = act->sa_handler;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user