diff options
author | David Carlier <devnexen@gmail.com> | 2021-03-30 18:48:56 +0100 |
---|---|---|
committer | Daniel Black <daniel@mariadb.org> | 2021-04-15 04:03:40 +1000 |
commit | 3ebd6cd3ad7c4f7584837d37452f3a456dd48085 (patch) | |
tree | e927f84ddfc315b9842afd3b4fe672f1292f2331 | |
parent | 022d3fa652d993ec198fb9f700ad4adb2fadcb41 (diff) | |
download | mariadb-git-3ebd6cd3ad7c4f7584837d37452f3a456dd48085.tar.gz |
signal handler, display coredump file pattern similarly to MDEV-25294 but for FreeBSD, thankfully the sysctl OID is the same.
-rw-r--r-- | sql/signal_handler.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sql/signal_handler.cc b/sql/signal_handler.cc index 61c53e6b6e3..08ea696752a 100644 --- a/sql/signal_handler.cc +++ b/sql/signal_handler.cc @@ -31,7 +31,7 @@ #endif -#ifdef __APPLE__ +#if defined(__APPLE__) || defined(__FreeBSD__) #include <sys/sysctl.h> #endif @@ -56,7 +56,7 @@ extern const char *optimizer_switch_names[]; static inline void output_core_info() { /* proc is optional on some BSDs so it can't hurt to look */ -#if defined(HAVE_READLINK) && !defined(__APPLE__) +#if defined(HAVE_READLINK) && !defined(__APPLE__) && !defined(__FreeBSD__) char buff[PATH_MAX]; ssize_t len; int fd; @@ -82,7 +82,7 @@ static inline void output_core_info() my_close(fd, MYF(0)); } #endif -#elif defined(__APPLE__) +#elif defined(__APPLE__) || defined(__FreeBSD__) char buff[PATH_MAX]; size_t len = sizeof(buff); if (sysctlbyname("kern.corefile", buff, &len, NULL, 0) == 0) |