[LTP] [PATCH v4 3/9] lib/tst_test: define TEST_VOID() macro

Sumit Garg sumit.garg@linaro.org
Thu Feb 21 10:00:10 CET 2019


Define TEST_VOID() macro for syscalls whose return type is void like
sync() etc.

Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
---
 include/tst_test.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/include/tst_test.h b/include/tst_test.h
index 12dda2e..03c88e3 100644
--- a/include/tst_test.h
+++ b/include/tst_test.h
@@ -216,6 +216,13 @@ void tst_reinit(void);
 		TST_ERR = errno; \
 	} while (0)
 
+#define TEST_VOID(SCALL) \
+	do { \
+		errno = 0; \
+		SCALL; \
+		TST_ERR = errno; \
+	} while (0)
+
 extern long TST_RET;
 extern int TST_ERR;
 
-- 
2.7.4



More information about the ltp mailing list