From 9272ed8666f930dc2f24d05b1fd248584bbf495f Mon Sep 17 00:00:00 2001 From: James Y Knight Date: Tue, 9 Jul 2019 14:31:24 -0400 Subject: [PATCH] Verify that returning to the original stack doesn't return an error (e.g. ENOMEM). --- src/regression/sigaltstack.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/regression/sigaltstack.c b/src/regression/sigaltstack.c index bfdc44a..6847454 100644 --- a/src/regression/sigaltstack.c +++ b/src/regression/sigaltstack.c @@ -30,7 +30,7 @@ static void handler(int sig) int main(void) { - stack_t ss; + stack_t ss, oldss; struct sigaction sa; ss.ss_sp = stack; @@ -39,7 +39,7 @@ int main(void) sa.sa_handler = handler; sa.sa_flags = SA_ONSTACK; - T(sigaltstack(&ss, 0)); + T(sigaltstack(&ss, &oldss)); T(sigfillset(&sa.sa_mask)); T(sigaction(SIGUSR1, &sa, 0)); T(raise(SIGUSR1)); @@ -56,7 +56,7 @@ int main(void) t_error("sigaltstack with bad ss_flags should have failed with EINVAL, " "got %s\n", strerror(errno)); errno = 0; - T(sigaltstack(0, 0)); + T(sigaltstack(oldss, 0)); return t_status; } -- 2.22.0.410.gd8fdbe21b5-goog