Don't use SA_RESTORER if it is not defined

This is a follow up to I47b0560a30aa33a9b1f1978dfb7f84d2e3d389b8.
This fixes MIPS32 build.

Test: successful build and boot aosp_mips-eng
Change-Id: Ia5b245f5536d8fd037f1798bbdf6215c5f059045
This commit is contained in:
Goran Jakovljevic 2018-02-07 11:05:54 +01:00
parent be6fbae74f
commit 87c6aac6d2
1 changed files with 6 additions and 0 deletions

View File

@ -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,