mirror of
https://git.proxmox.com/git/mirror_iproute2
synced 2025-08-13 03:46:21 +00:00
Use libbsd for strlcpy if available
If libc does not provide strlcpy check for libbsd with pkg-config to avoid relying on inline version. Signed-off-by: Luca Boccassi <bluca@debian.org> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
This commit is contained in:
parent
7a04dd84a7
commit
508f3c231e
11
configure
vendored
11
configure
vendored
@ -330,8 +330,15 @@ EOF
|
||||
then
|
||||
echo "no"
|
||||
else
|
||||
echo 'CFLAGS += -DNEED_STRLCPY' >>$CONFIG
|
||||
echo "yes"
|
||||
if ${PKG_CONFIG} libbsd --exists
|
||||
then
|
||||
echo 'CFLAGS += -DHAVE_LIBBSD' `${PKG_CONFIG} libbsd --cflags` >>$CONFIG
|
||||
echo 'LDLIBS +=' `${PKG_CONFIG} libbsd --libs` >> $CONFIG
|
||||
echo "no"
|
||||
else
|
||||
echo 'CFLAGS += -DNEED_STRLCPY' >>$CONFIG
|
||||
echo "yes"
|
||||
fi
|
||||
fi
|
||||
rm -f $TMPDIR/strtest.c $TMPDIR/strtest
|
||||
}
|
||||
|
@ -18,6 +18,9 @@
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <string.h>
|
||||
#ifdef HAVE_LIBBSD
|
||||
#include <bsd/string.h>
|
||||
#endif
|
||||
|
||||
#include "utils.h"
|
||||
#include "genl_utils.h"
|
||||
|
@ -24,6 +24,9 @@
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <string.h>
|
||||
#ifdef HAVE_LIBBSD
|
||||
#include <bsd/string.h>
|
||||
#endif
|
||||
#include <sys/ioctl.h>
|
||||
#include <stdbool.h>
|
||||
#include <linux/mpls.h>
|
||||
|
@ -8,6 +8,9 @@
|
||||
#include <sys/syscall.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#ifdef HAVE_LIBBSD
|
||||
#include <bsd/string.h>
|
||||
#endif
|
||||
#include <sched.h>
|
||||
#include <fcntl.h>
|
||||
#include <dirent.h>
|
||||
|
@ -16,6 +16,9 @@
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <string.h>
|
||||
#ifdef HAVE_LIBBSD
|
||||
#include <bsd/string.h>
|
||||
#endif
|
||||
#include <linux/ila.h>
|
||||
#include <linux/lwtunnel.h>
|
||||
#include <linux/mpls_iptunnel.h>
|
||||
|
@ -21,6 +21,9 @@
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#ifdef HAVE_LIBBSD
|
||||
#include <bsd/string.h>
|
||||
#endif
|
||||
#include <dirent.h>
|
||||
#include <errno.h>
|
||||
#include <limits.h>
|
||||
|
@ -28,6 +28,9 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#ifdef HAVE_LIBBSD
|
||||
#include <bsd/string.h>
|
||||
#endif
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <time.h>
|
||||
|
@ -24,6 +24,9 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#ifdef HAVE_LIBBSD
|
||||
#include <bsd/string.h>
|
||||
#endif
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include <sys/types.h>
|
||||
|
@ -27,6 +27,9 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#ifdef HAVE_LIBBSD
|
||||
#include <bsd/string.h>
|
||||
#endif
|
||||
#include <netdb.h>
|
||||
#include "utils.h"
|
||||
#include "xfrm.h"
|
||||
|
@ -15,6 +15,9 @@
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#ifdef HAVE_LIBBSD
|
||||
#include <bsd/string.h>
|
||||
#endif
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <errno.h>
|
||||
|
3
lib/fs.c
3
lib/fs.c
@ -20,6 +20,9 @@
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#ifdef HAVE_LIBBSD
|
||||
#include <bsd/string.h>
|
||||
#endif
|
||||
#include <errno.h>
|
||||
#include <limits.h>
|
||||
|
||||
|
@ -18,6 +18,9 @@
|
||||
#include <netinet/in.h>
|
||||
#include <netdb.h>
|
||||
#include <string.h>
|
||||
#ifdef HAVE_LIBBSD
|
||||
#include <bsd/string.h>
|
||||
#endif
|
||||
|
||||
#include "rt_names.h"
|
||||
#include "utils.h"
|
||||
|
@ -19,6 +19,9 @@
|
||||
#include <sys/sysmacros.h>
|
||||
#include <netinet/in.h>
|
||||
#include <string.h>
|
||||
#ifdef HAVE_LIBBSD
|
||||
#include <bsd/string.h>
|
||||
#endif
|
||||
#include <errno.h>
|
||||
#include <netdb.h>
|
||||
#include <arpa/inet.h>
|
||||
|
@ -20,6 +20,9 @@
|
||||
#include <netdb.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#ifdef HAVE_LIBBSD
|
||||
#include <bsd/string.h>
|
||||
#endif
|
||||
#include <stdlib.h>
|
||||
#include <getopt.h>
|
||||
|
||||
|
@ -23,6 +23,9 @@
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <string.h>
|
||||
#ifdef HAVE_LIBBSD
|
||||
#include <bsd/string.h>
|
||||
#endif
|
||||
#include <dlfcn.h>
|
||||
#include "utils.h"
|
||||
#include "tc_util.h"
|
||||
|
Loading…
Reference in New Issue
Block a user