summaryrefslogtreecommitdiff
path: root/lib/fib_lookup
diff options
context:
space:
mode:
authorAndré Draszik <adraszik@tycoint.com>2016-08-25 13:15:00 +0100
committerThomas Haller <thaller@redhat.com>2016-08-25 17:32:57 +0200
commitc1948ec29b8dcdc58d2d92700c325abdeab111a6 (patch)
tree1a6dffe6c8940716a6ff899e70e7e0b68e2a6dd2 /lib/fib_lookup
parent683f27fbb68ca2028a7b3468f17164d484df2759 (diff)
downloadlibnl-c1948ec29b8dcdc58d2d92700c325abdeab111a6.tar.gz
lib: switch to using strerror_l() instead of strerror_r()
glibc provides two versions of strerror_r(), which can be chosen between using feature test macros _GNU_SOURCE and _POSIX_C_SOURCE. libnl is built using the former, hence we get the glibc special version, and all code so far has been written for this. Other C libraries like musl on the other hand only try to be posix compliant, and only ever provide the posix version of strerror_r(), which has a different signature. Uses in libnl hence generally cause printf() of an *int* with a *string format* specifier for that reason. Additionally, strerror_r() has been deprecated: http://austingroupbugs.net/view.php?id=655 Switch to using strerror_l() (via our wrapper just introduced). Signed-off-by: André Draszik <adraszik@tycoint.com> Reviewed-by: Stephane Ayotte <sayotte@tycoint.com> Signed-off-by: Thomas Haller <thaller@redhat.com>
Diffstat (limited to 'lib/fib_lookup')
-rw-r--r--lib/fib_lookup/lookup.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/fib_lookup/lookup.c b/lib/fib_lookup/lookup.c
index 43b6126f..efc862b6 100644
--- a/lib/fib_lookup/lookup.c
+++ b/lib/fib_lookup/lookup.c
@@ -17,6 +17,7 @@
*/
#include <netlink-private/netlink.h>
+#include <netlink-private/utils.h>
#include <netlink/netlink.h>
#include <netlink/attr.h>
#include <netlink/utils.h>
@@ -133,7 +134,7 @@ static void result_dump_line(struct nl_object *obj, struct nl_dump_params *p)
nl_rtntype2str(res->fr_type, buf, sizeof(buf)));
nl_dump(p, "scope %s error %s (%d)\n",
rtnl_scope2str(res->fr_scope, buf, sizeof(buf)),
- strerror_r(-res->fr_error, buf, sizeof(buf)), res->fr_error);
+ nl_strerror_l(-res->fr_error), res->fr_error);
}
static void result_dump_details(struct nl_object *obj, struct nl_dump_params *p)