2008-08-19 Roland McGrath <roland@redhat.com>

* signal.c (sys_sigaction, sys_rt_sigaction): Don't omit the rest of
	the struct after sa_handler is a known constant.  Some sa_flags bits
	have meaning even for SIG_IGN/SIG_DFL.
This commit is contained in:
Roland McGrath 2008-08-20 01:59:40 +00:00
parent ab971652ac
commit 5f20681a25

View File

@ -1120,23 +1120,20 @@ struct tcb *tcp;
else if (umove(tcp, addr, &sa) < 0)
tprintf("{...}");
else {
switch ((long) sa.SA_HANDLER) {
case (long) SIG_ERR:
tprintf("{SIG_ERR}");
break;
case (long) SIG_DFL:
tprintf("{SIG_DFL}");
break;
case (long) SIG_IGN:
if (sa.SA_HANDLER == SIG_ERR)
tprintf("{SIG_ERR, ");
else if (sa.SA_HANDLER == SIG_DFL)
tprintf("{SIG_DFL, ");
else if (sa.SA_HANDLER == SIG_DFL) {
#ifndef USE_PROCFS
if (tcp->u_arg[0] == SIGTRAP) {
tcp->flags |= TCB_SIGTRAPPED;
kill(tcp->pid, SIGSTOP);
}
#endif /* !USE_PROCFS */
tprintf("{SIG_IGN}");
break;
default:
tprintf("{SIG_IGN, ");
}
else {
#ifndef USE_PROCFS
if (tcp->u_arg[0] == SIGTRAP) {
tcp->flags |= TCB_SIGTRAPPED;
@ -1865,7 +1862,7 @@ struct new_sigaction
};
int
int
sys_rt_sigaction(tcp)
struct tcb *tcp;
{
@ -1886,38 +1883,33 @@ sys_rt_sigaction(tcp)
else if (umove(tcp, addr, &sa) < 0)
tprintf("{...}");
else {
switch ((long) sa.__sigaction_handler.__sa_handler) {
case (long) SIG_ERR:
tprintf("{SIG_ERR}");
break;
case (long) SIG_DFL:
tprintf("{SIG_DFL}");
break;
case (long) SIG_IGN:
tprintf("{SIG_IGN}");
break;
default:
tprintf("{%#lx, ",
(long) sa.__sigaction_handler.__sa_handler);
sigemptyset(&sigset);
if (sa.__sigaction_handler.__sa_handler == SIG_ERR)
tprintf("{SIG_ERR, ");
else if (sa.__sigaction_handler.__sa_handler == SIG_DFL)
tprintf("{SIG_DFL, ");
else if (sa.__sigaction_handler.__sa_handler == SIG_DFL)
tprintf("{SIG_IGN, ");
else
tprintf("{%#lx, ",
(long) sa.__sigaction_handler.__sa_handler);
sigemptyset(&sigset);
#ifdef LINUXSPARC
if (tcp->u_arg[4] <= sizeof(sigset))
memcpy(&sigset, &sa.sa_mask, tcp->u_arg[4]);
if (tcp->u_arg[4] <= sizeof(sigset))
memcpy(&sigset, &sa.sa_mask, tcp->u_arg[4]);
#else
if (tcp->u_arg[3] <= sizeof(sigset))
memcpy(&sigset, &sa.sa_mask, tcp->u_arg[3]);
if (tcp->u_arg[3] <= sizeof(sigset))
memcpy(&sigset, &sa.sa_mask, tcp->u_arg[3]);
#endif
else
memcpy(&sigset, &sa.sa_mask, sizeof(sigset));
printsigmask(&sigset, 1);
tprintf(", ");
printflags(sigact_flags, sa.sa_flags, "SA_???");
else
memcpy(&sigset, &sa.sa_mask, sizeof(sigset));
printsigmask(&sigset, 1);
tprintf(", ");
printflags(sigact_flags, sa.sa_flags, "SA_???");
#ifdef SA_RESTORER
if (sa.sa_flags & SA_RESTORER)
tprintf(", %p", sa.sa_restorer);
if (sa.sa_flags & SA_RESTORER)
tprintf(", %p", sa.sa_restorer);
#endif
tprintf("}");
}
tprintf("}");
}
if (entering(tcp))
tprintf(", ");