diff mbox series

[v3,06/13] app/test: exclude ENOTSUP as failure

Message ID 1630729155-24584-7-git-send-email-jizh@linux.microsoft.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers show
Series app/test: enable subset of tests on Windows | expand

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Jie Zhou Sept. 4, 2021, 4:19 a.m. UTC
Check rte_errno to exclude ENOTSUP as failures in test_memory.c

Signed-off-by: Jie Zhou <jizh@linux.microsoft.com>
---
 app/test/test_memory.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/app/test/test_memory.c b/app/test/test_memory.c
index 7d5ae99bab..6f4fc02c03 100644
--- a/app/test/test_memory.c
+++ b/app/test/test_memory.c
@@ -9,6 +9,7 @@ 
 #include <rte_memory.h>
 #include <rte_common.h>
 #include <rte_memzone.h>
+#include <rte_errno.h>
 
 #include "test.h"
 
@@ -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;
@@ -62,7 +63,7 @@  check_seg_fds(const struct rte_memseg_list *msl, const struct rte_memseg *ms,
 	/* we're able to get memseg fd - try getting its offset */
 	ret = rte_memseg_get_fd_offset_thread_unsafe(ms, &offset);
 	if (ret < 0) {
-		if (errno == ENOTSUP)
+		if (rte_errno == ENOTSUP)
 			return 1;
 		return -1;
 	}