diff options
author | Lorenz <12514511+RincewindsHat@users.noreply.github.com> | 2023-03-11 10:34:47 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-11 10:34:47 (GMT) |
commit | 75342b53853a898bdd93c7d3da9374115bab6b6d (patch) | |
tree | 0c0af2b796bcdd8ddd42187beb5badb420db8dea /gl/m4/nocrash.m4 | |
parent | 6bbe0b7b0f609ecab831dec9be7690842bf0a0fc (diff) | |
parent | 357787868b5201ec3e874e7a225b1c944cbbdb4d (diff) | |
download | monitoring-plugins-75342b53853a898bdd93c7d3da9374115bab6b6d.tar.gz |
Merge branch 'master' into patch-1refs/pull/1842/head
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) |