From ef0350ce4cf5159224a6bce71e1a5c22ff72b523 Mon Sep 17 00:00:00 2001 From: Michael Kerrisk Date: Mon, 9 Aug 2021 02:19:43 +0200 Subject: [PATCH] sigaction.2: Minor tweaks to the code example Signed-off-by: Michael Kerrisk --- man2/sigaction.2 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/man2/sigaction.2 b/man2/sigaction.2 index 5262b81c9..3225dc990 100644 --- a/man2/sigaction.2 +++ b/man2/sigaction.2 @@ -1161,9 +1161,9 @@ handler(int signo, siginfo_t *info, void *context) { struct sigaction oldact; - if (sigaction(SIGSEGV, NULL, &oldact) != 0 || - (oldact.sa_flags & SA_UNSUPPORTED) || - !(oldact.sa_flags & SA_EXPOSE_TAGBITS)) { + if (sigaction(SIGSEGV, NULL, &oldact) == \-1 || + (oldact.sa_flags & SA_UNSUPPORTED) || + !(oldact.sa_flags & SA_EXPOSE_TAGBITS)) { _exit(EXIT_FAILURE); } _exit(EXIT_SUCCESS); @@ -1172,11 +1172,11 @@ handler(int signo, siginfo_t *info, void *context) int main(void) { - struct sigaction act = {0}; + struct sigaction act = { 0 }; act.sa_flags = SA_SIGINFO | SA_UNSUPPORTED | SA_EXPOSE_TAGBITS; act.sa_sigaction = &handler; - if (sigaction(SIGSEGV, &act, NULL) != 0) { + if (sigaction(SIGSEGV, &act, NULL) == \-1) { perror("sigaction"); exit(EXIT_FAILURE); }