diff --git a/libc/bionic/sigaction.cpp b/libc/bionic/sigaction.cpp index 53b2a028e..19a08e65c 100644 --- a/libc/bionic/sigaction.cpp +++ b/libc/bionic/sigaction.cpp @@ -90,7 +90,9 @@ int sigaction(int signal, const struct sigaction* bionic_new, struct sigaction* kernel_new = {}; kernel_new.sa_flags = bionic_new->sa_flags; kernel_new.sa_handler = bionic_new->sa_handler; +#if defined(SA_RESTORER) kernel_new.sa_restorer = bionic_new->sa_restorer; +#endif memcpy(&kernel_new.sa_mask, &bionic_new->sa_mask, sizeof(bionic_new->sa_mask)); } @@ -100,7 +102,9 @@ int sigaction(int signal, const struct sigaction* bionic_new, struct sigaction* *bionic_old = {}; bionic_old->sa_flags = kernel_old.sa_flags; bionic_old->sa_handler = kernel_old.sa_handler; +#if defined(SA_RESTORER) bionic_old->sa_restorer = kernel_old.sa_restorer; +#endif memcpy(&bionic_old->sa_mask, &kernel_old.sa_mask, sizeof(bionic_old->sa_mask)); } return result; @@ -110,10 +114,12 @@ int sigaction64(int signal, const struct sigaction64* bionic_new, struct sigacti struct sigaction64 kernel_new; if (bionic_new) { kernel_new = *bionic_new; +#if defined(SA_RESTORER) if (!(kernel_new.sa_flags & SA_RESTORER)) { kernel_new.sa_flags |= SA_RESTORER; kernel_new.sa_restorer = (kernel_new.sa_flags & SA_SIGINFO) ? &__restore_rt : &__restore; } +#endif } return __rt_sigaction(signal,