mirror of
https://github.com/samba-team/samba.git
synced 2025-02-28 01:58:17 +03:00
swrap: use LIBC_SO from GNU libc, if available
Look for gnu/lib-names.h and use the LIBC_SO define to dlopen libc, so the right library is loaded without manually searching for libc.so.N. Signed-off-by: Pino Toscano <toscano.pino@tiscali.it> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
This commit is contained in:
parent
7f36828fcc
commit
b5cd098054
@ -73,6 +73,9 @@
|
|||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#ifdef HAVE_GNU_LIB_NAMES_H
|
||||||
|
#include <gnu/lib-names.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
enum swrap_dbglvl_e {
|
enum swrap_dbglvl_e {
|
||||||
SWRAP_LOG_ERROR = 0,
|
SWRAP_LOG_ERROR = 0,
|
||||||
@ -418,6 +421,11 @@ static void *swrap_load_lib_handle(enum swrap_lib lib)
|
|||||||
/* FALL TROUGH */
|
/* FALL TROUGH */
|
||||||
case SWRAP_LIBC:
|
case SWRAP_LIBC:
|
||||||
handle = swrap.libc_handle;
|
handle = swrap.libc_handle;
|
||||||
|
#ifdef LIBC_SO
|
||||||
|
if (handle == NULL) {
|
||||||
|
handle = dlopen(LIBC_SO, flags);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
if (handle == NULL) {
|
if (handle == NULL) {
|
||||||
for (handle = NULL, i = 10; handle == NULL && i >= 0; i--) {
|
for (handle = NULL, i = 10; handle == NULL && i >= 0; i--) {
|
||||||
char soname[256] = {0};
|
char soname[256] = {0};
|
||||||
|
@ -41,6 +41,7 @@ def configure(conf):
|
|||||||
conf.CHECK_HEADERS('sys/signalfd.h')
|
conf.CHECK_HEADERS('sys/signalfd.h')
|
||||||
conf.CHECK_HEADERS('sys/eventfd.h')
|
conf.CHECK_HEADERS('sys/eventfd.h')
|
||||||
conf.CHECK_HEADERS('sys/timerfd.h')
|
conf.CHECK_HEADERS('sys/timerfd.h')
|
||||||
|
conf.CHECK_HEADERS('gnu/lib-names.h')
|
||||||
|
|
||||||
conf.CHECK_STRUCTURE_MEMBER('struct msghdr',
|
conf.CHECK_STRUCTURE_MEMBER('struct msghdr',
|
||||||
'msg_control',
|
'msg_control',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user