[LTP] [PATCH] write04.c: use TST_EXP_FAIL() macro
Avinesh Kumar
akumar@suse.de
Thu Jul 14 18:05:14 CEST 2022
Signed-off-by: Avinesh Kumar <akumar@suse.de>
---
testcases/kernel/syscalls/write/write04.c | 15 +--------------
1 file changed, 1 insertion(+), 14 deletions(-)
diff --git a/testcases/kernel/syscalls/write/write04.c b/testcases/kernel/syscalls/write/write04.c
index a765d91b7..565fddfb7 100644
--- a/testcases/kernel/syscalls/write/write04.c
+++ b/testcases/kernel/syscalls/write/write04.c
@@ -30,20 +30,7 @@ static void verify_write(void)
{
char wbuf[8 * page_size];
- TEST(write(wfd, wbuf, sizeof(wbuf)));
-
- if (TST_RET != -1) {
- tst_res(TFAIL, "write() succeeded unexpectedly");
- return;
- }
-
- if (TST_ERR != EAGAIN) {
- tst_res(TFAIL | TTERRNO,
- "write() failed unexpectedly, expected EAGAIN");
- return;
- }
-
- tst_res(TPASS | TTERRNO, "write() failed expectedly");
+ TST_EXP_FAIL(write(wfd, wbuf, sizeof(wbuf)), EAGAIN);
}
static void setup(void)
--
2.36.1
More information about the ltp
mailing list