All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH] syscalls/statvfs01: Close fd only on success
@ 2023-01-18 15:50 Cyril Hrubis
  2023-01-18 16:42 ` Petr Vorel
  0 siblings, 1 reply; 2+ messages in thread
From: Cyril Hrubis @ 2023-01-18 15:50 UTC (permalink / raw)
  To: ltp

This fixes TBROK in the case that the creat() call has failed
unexpectedly and allows the test to continue.

Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
---
 testcases/kernel/syscalls/statvfs/statvfs01.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/testcases/kernel/syscalls/statvfs/statvfs01.c b/testcases/kernel/syscalls/statvfs/statvfs01.c
index f17dc4cfa..c10c67b18 100644
--- a/testcases/kernel/syscalls/statvfs/statvfs01.c
+++ b/testcases/kernel/syscalls/statvfs/statvfs01.c
@@ -42,7 +42,8 @@ static void run(void)
 	toolong_fname[valid_len+1] = 0;
 
 	TST_EXP_FD(creat(valid_fname, 0444));
-	SAFE_CLOSE(TST_RET);
+	if (TST_PASS)
+		SAFE_CLOSE(TST_RET);
 
 	TST_EXP_FAIL(creat(toolong_fname, 0444), ENAMETOOLONG);
 }
-- 
2.38.2


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [LTP] [PATCH] syscalls/statvfs01: Close fd only on success
  2023-01-18 15:50 [LTP] [PATCH] syscalls/statvfs01: Close fd only on success Cyril Hrubis
@ 2023-01-18 16:42 ` Petr Vorel
  0 siblings, 0 replies; 2+ messages in thread
From: Petr Vorel @ 2023-01-18 16:42 UTC (permalink / raw)
  To: Cyril Hrubis; +Cc: ltp

Hi Cyril,

Obviously correct as well, thanks for fixing it.
Reviewed-by: Petr Vorel <pvorel@suse.cz>

Kind regards,
Petr

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-01-18 16:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-18 15:50 [LTP] [PATCH] syscalls/statvfs01: Close fd only on success Cyril Hrubis
2023-01-18 16:42 ` Petr Vorel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.