diff options
author | Lorenz Kästle <lorenz.kaestle@netways.de> | 2023-03-09 10:03:48 (GMT) |
---|---|---|
committer | Lorenz Kästle <lorenz.kaestle@netways.de> | 2023-03-09 10:03:48 (GMT) |
commit | d0edb72a0c9bc1a28197ab4566928f7ee63a6d43 (patch) | |
tree | 6d524fb16d2dd1aa9f2d98529ef1de7a39f52700 /gl/m4/nocrash.m4 | |
parent | 9fdc82f0543c6e2891c7079f70297f92e8ef4619 (diff) | |
parent | 269718094177fb8a7e3d3005d1310495009fe8c4 (diff) | |
download | monitoring-plugins-d0edb72a0c9bc1a28197ab4566928f7ee63a6d43.tar.gz |
Merge branch 'master' into RincewindsHat-patch-1
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) |