use separate sigaction buffers for old and new data

in signal() it is needed since __sigaction uses restrict in parameters
and sharing the buffer is technically an aliasing error. do the same
for the syscall, as at least qemu-user does not handle it properly.
This commit is contained in:
Timo Teräs
2013-07-30 09:14:56 -04:00
committed by Rich Felker
parent 372a948b81
commit 48748143a3
2 changed files with 8 additions and 8 deletions

View File

@ -7,10 +7,10 @@ int __sigaction(int, const struct sigaction *, struct sigaction *);
void (*signal(int sig, void (*func)(int)))(int)
{
struct sigaction sa = { .sa_handler = func, .sa_flags = SA_RESTART };
if (__sigaction(sig, &sa, &sa) < 0)
struct sigaction sa_old, sa = { .sa_handler = func, .sa_flags = SA_RESTART };
if (__sigaction(sig, &sa, &sa_old) < 0)
return SIG_ERR;
return sa.sa_handler;
return sa_old.sa_handler;
}
weak_alias(signal, bsd_signal);