mirror of https://github.com/mkerrisk/man-pages
sigaction.2: Minor tweaks to the code example
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
parent
1875f17753
commit
ef0350ce4c
|
@ -1161,7 +1161,7 @@ handler(int signo, siginfo_t *info, void *context)
|
|||
{
|
||||
struct sigaction oldact;
|
||||
|
||||
if (sigaction(SIGSEGV, NULL, &oldact) != 0 ||
|
||||
if (sigaction(SIGSEGV, NULL, &oldact) == \-1 ||
|
||||
(oldact.sa_flags & SA_UNSUPPORTED) ||
|
||||
!(oldact.sa_flags & SA_EXPOSE_TAGBITS)) {
|
||||
_exit(EXIT_FAILURE);
|
||||
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue