]> git.ipfire.org Git - thirdparty/iproute2.git/commit
lib: fix multiple strlcpy definition
authorBaruch Siach <baruch@tkos.co.il>
Mon, 9 Oct 2017 05:49:44 +0000 (08:49 +0300)
committerStephen Hemminger <stephen@networkplumber.org>
Wed, 11 Oct 2017 18:02:13 +0000 (11:02 -0700)
commit4f6b73380d2c84b98b7beffe6ca73f635ab72a06
tree7ae61e1e978822438607a674e8ec9b208d6b145c
parentecd44e680576c793f2a943d00301215f09882c59
lib: fix multiple strlcpy definition

Some C libraries, like uClibc and musl, provide BSD compatible
strlcpy(). Add check_strlcpy() to configure, and avoid defining strlcpy
and strlcat when the C library provides them.

This fixes the following static link error with uClibc-ng:

.../sysroot/usr/lib/libc.a(strlcpy.os): In function `strlcpy':
strlcpy.c:(.text+0x0): multiple definition of `strlcpy'
../lib/libutil.a(utils.o):utils.c:(.text+0x1ddc): first defined here
collect2: error: ld returned 1 exit status

Acked-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
configure
lib/utils.c