All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH 1/1] setsockopt10: Fix running with more iterations
@ 2026-07-20 21:36 Petr Vorel
  2026-07-20 22:02 ` [LTP] " linuxtestproject.agent
  2026-07-21 12:44 ` [LTP] [PATCH 1/1] " Andrea Cervesato via ltp
  0 siblings, 2 replies; 3+ messages in thread
From: Petr Vorel @ 2026-07-20 21:36 UTC (permalink / raw)
  To: ltp

Do proper cleanup SAFE_CLOSE(tcp1_sk) before return to fix test when
running with more iterations:

    # ./setsockopt10  -i1022
    ...
    setsockopt10.c:165: TPASS: parent: tls disallows disconnect: EOPNOTSUPP (95)
    setsockopt10.c:116: TINFO: child: connect for tcp2 connection
    setsockopt10.c:120: TINFO: child: could not connect to tcp1: ECONNREFUSED (111)
    setsockopt10.c:134: TBROK: socket(2, 1, 0) failed: EMFILE (24)

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 testcases/kernel/syscalls/setsockopt/setsockopt10.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/testcases/kernel/syscalls/setsockopt/setsockopt10.c b/testcases/kernel/syscalls/setsockopt/setsockopt10.c
index 76c977d2eb..b12f7bf166 100644
--- a/testcases/kernel/syscalls/setsockopt/setsockopt10.c
+++ b/testcases/kernel/syscalls/setsockopt/setsockopt10.c
@@ -167,6 +167,7 @@ static void run(void)
 			tst_res(TFAIL | TTERRNO, "parent: unexpected errno from connect");
 		TST_CHECKPOINT_WAKE(2);
 		tst_reap_children();
+		SAFE_CLOSE(tcp1_sk);
 		return;
 	}
 
@@ -183,6 +184,7 @@ static void run(void)
 
 		TST_CHECKPOINT_WAKE(2);
 		tst_reap_children();
+		SAFE_CLOSE(tcp1_sk);
 		return;
 	}
 
-- 
2.55.0


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

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

end of thread, other threads:[~2026-07-21 12:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-20 21:36 [LTP] [PATCH 1/1] setsockopt10: Fix running with more iterations Petr Vorel
2026-07-20 22:02 ` [LTP] " linuxtestproject.agent
2026-07-21 12:44 ` [LTP] [PATCH 1/1] " Andrea Cervesato via ltp

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.