From: Bruce Richardson Date: Fri, 17 Sep 2021 15:09:17 +0000 (+0100) Subject: test/mem: fix memory autotests on FreeBSD X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=086d426406bd3f6fac96a15bbd871c7fe714bc2d;p=dpdk.git test/mem: fix memory autotests on FreeBSD The memory autotests were failing on FreeBSD, due to an incorrect errno variable being checked for ENOTSUP. The test checked "errno" while the DPDK API sets "rte_errno". Changing to check the right variable makes the test behave properly. Fixes: c3e35a0966b8 ("test/mem: check segment fd API") Reported-by: Brandon Lo Signed-off-by: Bruce Richardson Reviewed-by: David Marchand --- diff --git a/app/test/test_memory.c b/app/test/test_memory.c index 7d5ae99bab..dbf6871e71 100644 --- a/app/test/test_memory.c +++ b/app/test/test_memory.c @@ -6,6 +6,7 @@ #include #include +#include #include #include #include @@ -53,7 +54,7 @@ check_seg_fds(const struct rte_memseg_list *msl, const struct rte_memseg *ms, /* ENOTSUP means segment is valid, but there is not support for * segment fd API (e.g. on FreeBSD). */ - if (errno == ENOTSUP) + if (rte_errno == ENOTSUP) return 1; /* all other errors are treated as failures */ return -1;