Thread (27 messages) 27 messages, 5 authors, 2023-06-29

[dpdk-dev] [PATCH v6 3/3] app/test: fix return value of test_kni_link_change

From: Igor Ryzhov <hidden>
Date: 2021-08-30 14:27:45
Subsystem: the rest · Maintainer: Linus Torvalds

If the child process returns -1, WEXITSTATUS converts to 255 because it
takes only 8 least significant bits. As a result, the test is not
considered failed when it should.

Signed-off-by: Igor Ryzhov <redacted>
---
 app/test/test_kni.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/test/test_kni.c b/app/test/test_kni.c
index 0df028696f36..70c81f4af0f4 100644
--- a/app/test/test_kni.c
+++ b/app/test/test_kni.c
@@ -214,7 +214,7 @@ test_kni_link_change(void)
 			p_ret = waitpid(pid, &status, WNOHANG);
 			if (p_ret != 0) {
 				if (WIFEXITED(status))
-					return WEXITSTATUS(status);
+					return WEXITSTATUS(status) ? -1 : 0;
 				return -1;
 			}
 			rte_delay_ms(10);
-- 
2.33.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help