1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-18 00:10:04 +00:00

net/haproxy: update patch from upstream, no functional changes.

This commit is contained in:
Dmitry Sivachenko 2024-04-02 13:05:40 +00:00
parent 51ce4b0fb8
commit c4a32bb1a8
5 changed files with 215 additions and 65 deletions

View File

@ -1,32 +1,62 @@
--- src/tools.c.orig
From c03a02388257e21810c534d50a93658e61a83494 Mon Sep 17 00:00:00 2001
From: Brooks Davis <brooks@one-eyed-alien.net>
Date: Wed, 28 Feb 2024 18:12:40 +0000
Subject: [PATCH] MINOR: tools: use public interface for FreeBSD
get_exec_path()
Where possible (FreeBSD 13+), use the public, documented interface to
the ELF auxiliary argument vector: elf_aux_info().
__elf_aux_vector is a private interface exported so that the runtime
linker can set its value during process startup and not intended for
public consumption. In FreeBSD 15 it has been removed from libc and
moved to libsys.
---
src/tools.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/src/tools.c b/src/tools.c
index e1ba241..4759222 100644
--- src/tools.c
+++ src/tools.c
@@ -17,9 +17,7 @@
@@ -17,9 +17,14 @@
#endif
#if defined(__FreeBSD__)
-#include <elf.h>
-#include <dlfcn.h>
-extern void *__elf_aux_vector;
+#include <sys/param.h>
+#if __FreeBSD_version < 1300058
#include <elf.h>
#include <dlfcn.h>
extern void *__elf_aux_vector;
+#else
+#include <sys/auxv.h>
+#endif
#endif
#if defined(__NetBSD__)
@@ -5018,13 +5016,11 @@
@@ -5018,6 +5023,7 @@ const char *get_exec_path()
if (execfn && execfn != ENOENT)
ret = (const char *)execfn;
#elif defined(__FreeBSD__)
- Elf_Auxinfo *auxv;
- for (auxv = __elf_aux_vector; auxv->a_type != AT_NULL; ++auxv) {
- if (auxv->a_type == AT_EXECPATH) {
- ret = (const char *)auxv->a_un.a_ptr;
- break;
- }
- }
+#if __FreeBSD_version < 1300058
Elf_Auxinfo *auxv;
for (auxv = __elf_aux_vector; auxv->a_type != AT_NULL; ++auxv) {
if (auxv->a_type == AT_EXECPATH) {
@@ -5025,6 +5031,14 @@ const char *get_exec_path()
break;
}
}
+#else
+ static char execpath[MAXPATHLEN];
+
+ if (execpath[0] == '\0')
+ elf_aux_info(AT_EXECPATH, execpath, MAXPATHLEN);
+ if (execpath[0] != '\0')
+ ret = execpath;
+#endif
#elif defined(__NetBSD__)
AuxInfo *auxv;
for (auxv = _dlauxinfo(); auxv->a_type != AT_NULL; ++auxv) {
--
1.7.10.4

View File

@ -1,32 +1,62 @@
--- src/tools.c.orig
From c03a02388257e21810c534d50a93658e61a83494 Mon Sep 17 00:00:00 2001
From: Brooks Davis <brooks@one-eyed-alien.net>
Date: Wed, 28 Feb 2024 18:12:40 +0000
Subject: [PATCH] MINOR: tools: use public interface for FreeBSD
get_exec_path()
Where possible (FreeBSD 13+), use the public, documented interface to
the ELF auxiliary argument vector: elf_aux_info().
__elf_aux_vector is a private interface exported so that the runtime
linker can set its value during process startup and not intended for
public consumption. In FreeBSD 15 it has been removed from libc and
moved to libsys.
---
src/tools.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/src/tools.c b/src/tools.c
index e1ba241..4759222 100644
--- src/tools.c
+++ src/tools.c
@@ -17,9 +17,7 @@
@@ -17,9 +17,14 @@
#endif
#if defined(__FreeBSD__)
-#include <elf.h>
-#include <dlfcn.h>
-extern void *__elf_aux_vector;
+#include <sys/param.h>
+#if __FreeBSD_version < 1300058
#include <elf.h>
#include <dlfcn.h>
extern void *__elf_aux_vector;
+#else
+#include <sys/auxv.h>
+#endif
#endif
#if defined(__NetBSD__)
@@ -5018,13 +5016,11 @@
@@ -5018,6 +5023,7 @@ const char *get_exec_path()
if (execfn && execfn != ENOENT)
ret = (const char *)execfn;
#elif defined(__FreeBSD__)
- Elf_Auxinfo *auxv;
- for (auxv = __elf_aux_vector; auxv->a_type != AT_NULL; ++auxv) {
- if (auxv->a_type == AT_EXECPATH) {
- ret = (const char *)auxv->a_un.a_ptr;
- break;
- }
- }
+#if __FreeBSD_version < 1300058
Elf_Auxinfo *auxv;
for (auxv = __elf_aux_vector; auxv->a_type != AT_NULL; ++auxv) {
if (auxv->a_type == AT_EXECPATH) {
@@ -5025,6 +5031,14 @@ const char *get_exec_path()
break;
}
}
+#else
+ static char execpath[MAXPATHLEN];
+
+ if (execpath[0] == '\0')
+ elf_aux_info(AT_EXECPATH, execpath, MAXPATHLEN);
+ if (execpath[0] != '\0')
+ ret = execpath;
+#endif
#elif defined(__NetBSD__)
AuxInfo *auxv;
for (auxv = _dlauxinfo(); auxv->a_type != AT_NULL; ++auxv) {
--
1.7.10.4

View File

@ -1,32 +1,62 @@
--- src/tools.c.orig
From c03a02388257e21810c534d50a93658e61a83494 Mon Sep 17 00:00:00 2001
From: Brooks Davis <brooks@one-eyed-alien.net>
Date: Wed, 28 Feb 2024 18:12:40 +0000
Subject: [PATCH] MINOR: tools: use public interface for FreeBSD
get_exec_path()
Where possible (FreeBSD 13+), use the public, documented interface to
the ELF auxiliary argument vector: elf_aux_info().
__elf_aux_vector is a private interface exported so that the runtime
linker can set its value during process startup and not intended for
public consumption. In FreeBSD 15 it has been removed from libc and
moved to libsys.
---
src/tools.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/src/tools.c b/src/tools.c
index e1ba241..4759222 100644
--- src/tools.c
+++ src/tools.c
@@ -17,9 +17,7 @@
@@ -17,9 +17,14 @@
#endif
#if defined(__FreeBSD__)
-#include <elf.h>
-#include <dlfcn.h>
-extern void *__elf_aux_vector;
+#include <sys/param.h>
+#if __FreeBSD_version < 1300058
#include <elf.h>
#include <dlfcn.h>
extern void *__elf_aux_vector;
+#else
+#include <sys/auxv.h>
+#endif
#endif
#if defined(__NetBSD__)
@@ -5018,13 +5016,11 @@
@@ -5018,6 +5023,7 @@ const char *get_exec_path()
if (execfn && execfn != ENOENT)
ret = (const char *)execfn;
#elif defined(__FreeBSD__)
- Elf_Auxinfo *auxv;
- for (auxv = __elf_aux_vector; auxv->a_type != AT_NULL; ++auxv) {
- if (auxv->a_type == AT_EXECPATH) {
- ret = (const char *)auxv->a_un.a_ptr;
- break;
- }
- }
+#if __FreeBSD_version < 1300058
Elf_Auxinfo *auxv;
for (auxv = __elf_aux_vector; auxv->a_type != AT_NULL; ++auxv) {
if (auxv->a_type == AT_EXECPATH) {
@@ -5025,6 +5031,14 @@ const char *get_exec_path()
break;
}
}
+#else
+ static char execpath[MAXPATHLEN];
+
+ if (execpath[0] == '\0')
+ elf_aux_info(AT_EXECPATH, execpath, MAXPATHLEN);
+ if (execpath[0] != '\0')
+ ret = execpath;
+#endif
#elif defined(__NetBSD__)
AuxInfo *auxv;
for (auxv = _dlauxinfo(); auxv->a_type != AT_NULL; ++auxv) {
--
1.7.10.4

View File

@ -1,32 +1,62 @@
--- src/tools.c.orig
From c03a02388257e21810c534d50a93658e61a83494 Mon Sep 17 00:00:00 2001
From: Brooks Davis <brooks@one-eyed-alien.net>
Date: Wed, 28 Feb 2024 18:12:40 +0000
Subject: [PATCH] MINOR: tools: use public interface for FreeBSD
get_exec_path()
Where possible (FreeBSD 13+), use the public, documented interface to
the ELF auxiliary argument vector: elf_aux_info().
__elf_aux_vector is a private interface exported so that the runtime
linker can set its value during process startup and not intended for
public consumption. In FreeBSD 15 it has been removed from libc and
moved to libsys.
---
src/tools.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/src/tools.c b/src/tools.c
index e1ba241..4759222 100644
--- src/tools.c
+++ src/tools.c
@@ -17,9 +17,7 @@
@@ -17,9 +17,14 @@
#endif
#if defined(__FreeBSD__)
-#include <elf.h>
-#include <dlfcn.h>
-extern void *__elf_aux_vector;
+#include <sys/param.h>
+#if __FreeBSD_version < 1300058
#include <elf.h>
#include <dlfcn.h>
extern void *__elf_aux_vector;
+#else
+#include <sys/auxv.h>
+#endif
#endif
#if defined(__NetBSD__)
@@ -5018,13 +5016,11 @@
@@ -5018,6 +5023,7 @@ const char *get_exec_path()
if (execfn && execfn != ENOENT)
ret = (const char *)execfn;
#elif defined(__FreeBSD__)
- Elf_Auxinfo *auxv;
- for (auxv = __elf_aux_vector; auxv->a_type != AT_NULL; ++auxv) {
- if (auxv->a_type == AT_EXECPATH) {
- ret = (const char *)auxv->a_un.a_ptr;
- break;
- }
- }
+#if __FreeBSD_version < 1300058
Elf_Auxinfo *auxv;
for (auxv = __elf_aux_vector; auxv->a_type != AT_NULL; ++auxv) {
if (auxv->a_type == AT_EXECPATH) {
@@ -5025,6 +5031,14 @@ const char *get_exec_path()
break;
}
}
+#else
+ static char execpath[MAXPATHLEN];
+
+ if (execpath[0] == '\0')
+ elf_aux_info(AT_EXECPATH, execpath, MAXPATHLEN);
+ if (execpath[0] != '\0')
+ ret = execpath;
+#endif
#elif defined(__NetBSD__)
AuxInfo *auxv;
for (auxv = _dlauxinfo(); auxv->a_type != AT_NULL; ++auxv) {
--
1.7.10.4

View File

@ -1,32 +1,62 @@
--- src/tools.c.orig
From c03a02388257e21810c534d50a93658e61a83494 Mon Sep 17 00:00:00 2001
From: Brooks Davis <brooks@one-eyed-alien.net>
Date: Wed, 28 Feb 2024 18:12:40 +0000
Subject: [PATCH] MINOR: tools: use public interface for FreeBSD
get_exec_path()
Where possible (FreeBSD 13+), use the public, documented interface to
the ELF auxiliary argument vector: elf_aux_info().
__elf_aux_vector is a private interface exported so that the runtime
linker can set its value during process startup and not intended for
public consumption. In FreeBSD 15 it has been removed from libc and
moved to libsys.
---
src/tools.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/src/tools.c b/src/tools.c
index e1ba241..4759222 100644
--- src/tools.c
+++ src/tools.c
@@ -17,9 +17,7 @@
@@ -17,9 +17,14 @@
#endif
#if defined(__FreeBSD__)
-#include <elf.h>
-#include <dlfcn.h>
-extern void *__elf_aux_vector;
+#include <sys/param.h>
+#if __FreeBSD_version < 1300058
#include <elf.h>
#include <dlfcn.h>
extern void *__elf_aux_vector;
+#else
+#include <sys/auxv.h>
+#endif
#endif
#if defined(__NetBSD__)
@@ -5018,13 +5016,11 @@
@@ -5018,6 +5023,7 @@ const char *get_exec_path()
if (execfn && execfn != ENOENT)
ret = (const char *)execfn;
#elif defined(__FreeBSD__)
- Elf_Auxinfo *auxv;
- for (auxv = __elf_aux_vector; auxv->a_type != AT_NULL; ++auxv) {
- if (auxv->a_type == AT_EXECPATH) {
- ret = (const char *)auxv->a_un.a_ptr;
- break;
- }
- }
+#if __FreeBSD_version < 1300058
Elf_Auxinfo *auxv;
for (auxv = __elf_aux_vector; auxv->a_type != AT_NULL; ++auxv) {
if (auxv->a_type == AT_EXECPATH) {
@@ -5025,6 +5031,14 @@ const char *get_exec_path()
break;
}
}
+#else
+ static char execpath[MAXPATHLEN];
+
+ if (execpath[0] == '\0')
+ elf_aux_info(AT_EXECPATH, execpath, MAXPATHLEN);
+ if (execpath[0] != '\0')
+ ret = execpath;
+#endif
#elif defined(__NetBSD__)
AuxInfo *auxv;
for (auxv = _dlauxinfo(); auxv->a_type != AT_NULL; ++auxv) {
--
1.7.10.4