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
diff --git a/libc/bionic/sigaction.cpp b/libc/bionic/sigaction.cpp
index 53b2a02..19a08e6 100644
--- a/libc/bionic/sigaction.cpp
+++ b/libc/bionic/sigaction.cpp
@@ -90,7 +90,9 @@
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 @@
*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 @@
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,