diff options
author | Lorenz <12514511+RincewindsHat@users.noreply.github.com> | 2023-03-27 10:34:19 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-27 10:34:19 (GMT) |
commit | bbc97d57f7f9e0a49fea78c02861c444fe95d46a (patch) | |
tree | c8956bbbe9b73e37d261735699a82cccaacea0db /gl/m4/nocrash.m4 | |
parent | 917dba07fded8ef04967183a4c0443b5cce2db82 (diff) | |
parent | 482aa6c7fe86d7a899e4888d14149f1ccd5401fd (diff) | |
download | monitoring-plugins-bbc97d57f7f9e0a49fea78c02861c444fe95d46a.tar.gz |
Merge branch 'master' into dev/check_ssh-patches
Diffstat (limited to 'gl/m4/nocrash.m4')
-rw-r--r-- | gl/m4/nocrash.m4 | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/gl/m4/nocrash.m4 b/gl/m4/nocrash.m4 index 105b884..6a76638 100644 --- a/gl/m4/nocrash.m4 +++ b/gl/m4/nocrash.m4 | |||
@@ -1,5 +1,5 @@ | |||
1 | # nocrash.m4 serial 4 | 1 | # nocrash.m4 serial 5 |
2 | dnl Copyright (C) 2005, 2009-2013 Free Software Foundation, Inc. | 2 | dnl Copyright (C) 2005, 2009-2023 Free Software Foundation, Inc. |
3 | dnl This file is free software; the Free Software Foundation | 3 | dnl This file is free software; the Free Software Foundation |
4 | dnl gives unlimited permission to copy and/or distribute it, | 4 | dnl gives unlimited permission to copy and/or distribute it, |
5 | dnl with or without modifications, as long as this notice is preserved. | 5 | dnl with or without modifications, as long as this notice is preserved. |
@@ -53,7 +53,7 @@ nocrash_init (void) | |||
53 | /* Allocate a port on which the thread shall listen for exceptions. */ | 53 | /* Allocate a port on which the thread shall listen for exceptions. */ |
54 | if (mach_port_allocate (self, MACH_PORT_RIGHT_RECEIVE, &our_exception_port) | 54 | if (mach_port_allocate (self, MACH_PORT_RIGHT_RECEIVE, &our_exception_port) |
55 | == KERN_SUCCESS) { | 55 | == KERN_SUCCESS) { |
56 | /* See http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/mach_port_insert_right.html. */ | 56 | /* See https://web.mit.edu/darwin/src/modules/xnu/osfmk/man/mach_port_insert_right.html. */ |
57 | if (mach_port_insert_right (self, our_exception_port, our_exception_port, | 57 | if (mach_port_insert_right (self, our_exception_port, our_exception_port, |
58 | MACH_MSG_TYPE_MAKE_SEND) | 58 | MACH_MSG_TYPE_MAKE_SEND) |
59 | == KERN_SUCCESS) { | 59 | == KERN_SUCCESS) { |
@@ -72,14 +72,14 @@ nocrash_init (void) | |||
72 | for a particular thread. This has the effect that when our exception | 72 | for a particular thread. This has the effect that when our exception |
73 | port gets the message, the thread specific exception port has already | 73 | port gets the message, the thread specific exception port has already |
74 | been asked, and we don't need to bother about it. | 74 | been asked, and we don't need to bother about it. |
75 | See http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/task_set_exception_ports.html. */ | 75 | See https://web.mit.edu/darwin/src/modules/xnu/osfmk/man/task_set_exception_ports.html. */ |
76 | task_set_exception_ports (self, mask, our_exception_port, | 76 | task_set_exception_ports (self, mask, our_exception_port, |
77 | EXCEPTION_DEFAULT, MACHINE_THREAD_STATE); | 77 | EXCEPTION_DEFAULT, MACHINE_THREAD_STATE); |
78 | } | 78 | } |
79 | } | 79 | } |
80 | } | 80 | } |
81 | } | 81 | } |
82 | #elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ | 82 | #elif defined _WIN32 && ! defined __CYGWIN__ |
83 | /* Avoid a crash on native Windows. */ | 83 | /* Avoid a crash on native Windows. */ |
84 | #define WIN32_LEAN_AND_MEAN | 84 | #define WIN32_LEAN_AND_MEAN |
85 | #include <windows.h> | 85 | #include <windows.h> |
@@ -110,11 +110,12 @@ nocrash_init (void) | |||
110 | #else | 110 | #else |
111 | /* Avoid a crash on POSIX systems. */ | 111 | /* Avoid a crash on POSIX systems. */ |
112 | #include <signal.h> | 112 | #include <signal.h> |
113 | #include <unistd.h> | ||
113 | /* A POSIX signal handler. */ | 114 | /* A POSIX signal handler. */ |
114 | static void | 115 | static void |
115 | exception_handler (int sig) | 116 | exception_handler (int sig) |
116 | { | 117 | { |
117 | exit (1); | 118 | _exit (1); |
118 | } | 119 | } |
119 | static void | 120 | static void |
120 | nocrash_init (void) | 121 | nocrash_init (void) |