Commit 3ebd6cd3 authored by David Carlier's avatar David Carlier Committed by Daniel Black

signal handler, display coredump file pattern similarly to MDEV-25294 but for...

signal handler, display coredump file pattern similarly to MDEV-25294 but for FreeBSD, thankfully the sysctl OID is the same.
parent 022d3fa6
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
#endif #endif
#ifdef __APPLE__ #if defined(__APPLE__) || defined(__FreeBSD__)
#include <sys/sysctl.h> #include <sys/sysctl.h>
#endif #endif
...@@ -56,7 +56,7 @@ extern const char *optimizer_switch_names[]; ...@@ -56,7 +56,7 @@ extern const char *optimizer_switch_names[];
static inline void output_core_info() static inline void output_core_info()
{ {
/* proc is optional on some BSDs so it can't hurt to look */ /* 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]; char buff[PATH_MAX];
ssize_t len; ssize_t len;
int fd; int fd;
...@@ -82,7 +82,7 @@ static inline void output_core_info() ...@@ -82,7 +82,7 @@ static inline void output_core_info()
my_close(fd, MYF(0)); my_close(fd, MYF(0));
} }
#endif #endif
#elif defined(__APPLE__) #elif defined(__APPLE__) || defined(__FreeBSD__)
char buff[PATH_MAX]; char buff[PATH_MAX];
size_t len = sizeof(buff); size_t len = sizeof(buff);
if (sysctlbyname("kern.corefile", buff, &len, NULL, 0) == 0) if (sysctlbyname("kern.corefile", buff, &len, NULL, 0) == 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment