mirror of
https://github.com/fluencelabs/musl
synced 2025-06-12 22:41:37 +00:00
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:
@ -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);
|
||||
|
Reference in New Issue
Block a user