summaryrefslogtreecommitdiff
path: root/mysys
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2022-11-21 10:32:08 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2022-11-21 10:32:08 +0200
commitbebe193979405b28b15af008621248ed117e54a4 (patch)
tree4947916c6c2afed02dc14494e8990d293c2c816d /mysys
parentbb894f2376bff6ada36a3f627d4b1bf27ee9ca2a (diff)
parentb35a048ece4f5dd7c6757d86a303f27187a16117 (diff)
downloadmariadb-git-bebe193979405b28b15af008621248ed117e54a4.tar.gz
Merge 10.9 into 10.10
Diffstat (limited to 'mysys')
-rw-r--r--mysys/my_addr_resolve.c12
-rw-r--r--mysys/my_fopen.c2
-rw-r--r--mysys/my_gethwaddr.c12
3 files changed, 21 insertions, 5 deletions
diff --git a/mysys/my_addr_resolve.c b/mysys/my_addr_resolve.c
index 444a47bb7c5..2d4385f4684 100644
--- a/mysys/my_addr_resolve.c
+++ b/mysys/my_addr_resolve.c
@@ -202,7 +202,7 @@ int start_addr2line_fork(const char *binary_path)
close(out[0]);
close(out[1]);
execlp("addr2line", "addr2line", "-C", "-f", "-e", binary_path, NULL);
- exit(1);
+ _exit(1);
}
close(in[0]);
@@ -319,12 +319,20 @@ int my_addr_resolve(void *ptr, my_addr_loc *loc)
/* Save result for future comparisons. */
strnmov(addr2line_binary, info.dli_fname, sizeof(addr2line_binary));
+#ifdef _AIX
+ /*
+ info.dli_fbase is a char on AIX and casting it doesn't fool gcc.
+ leave backtracing broken on AIX until a real solution can be found.
+ */
+ addr_offset= NULL;
+#else
/*
Check if we should use info.dli_fbase as an offset or not
for the base program. This is depending on if the compilation is
done with PIE or not.
*/
- addr_offset= (void*) info.dli_fbase;
+ addr_offset= info.dli_fbase;
+#endif
#ifndef __PIE__
if (strcmp(info.dli_fname, my_progname) == 0 &&
addr_resolve((void*) my_addr_resolve, loc) == 0 &&
diff --git a/mysys/my_fopen.c b/mysys/my_fopen.c
index 25b492846e5..2bc1da52d66 100644
--- a/mysys/my_fopen.c
+++ b/mysys/my_fopen.c
@@ -291,6 +291,8 @@ static void make_ftype(register char * to, register int flag)
if (flag & FILE_BINARY)
*to++='b';
+ else if (flag & O_TEXT)
+ *to++= 't';
if (O_CLOEXEC)
*to++= 'e';
diff --git a/mysys/my_gethwaddr.c b/mysys/my_gethwaddr.c
index 6bba553a549..1f344af88fd 100644
--- a/mysys/my_gethwaddr.c
+++ b/mysys/my_gethwaddr.c
@@ -23,7 +23,7 @@
#ifndef MAIN
-#if defined(_AIX) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__linux__) || defined(__sun) || defined(_WIN32)
+#if defined(_AIX) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__linux__) || defined(__sun) || defined(_WIN32)
static my_bool memcpy_and_test(uchar *to, uchar *from, uint len)
{
uint i, res= 1;
@@ -35,8 +35,14 @@ static my_bool memcpy_and_test(uchar *to, uchar *from, uint len)
}
#endif
-#if defined(__APPLE__) || defined(__FreeBSD__)
+#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__)
+#ifdef __OpenBSD__
+#include <netinet/in.h>
+#include <net/if_arp.h>
+#include <netinet/if_ether.h>
+#else
#include <net/ethernet.h>
+#endif
#include <sys/sysctl.h>
#include <net/route.h>
#include <net/if.h>
@@ -110,7 +116,7 @@ my_bool my_gethwaddr(uchar *to)
uint i;
for (i= 0; res && i < ifc.ifc_len / sizeof(ifr[0]); i++)
{
-#if !defined(_AIX) || !defined(__linux__)
+#if defined(_AIX) || defined(__linux__)
#if defined(__linux__)
#define HWADDR_DATA ifr[i].ifr_hwaddr.sa_data
#else