From: menglong8.dong@gmail.com
To: mathew.j.martineau@linux.intel.com, matthieu.baerts@tessares.net
Cc: mptcp@lists.linux.dev, Menglong Dong <imagedong@tencent.com>
Subject: [PATCH mptcp-next v6 3/4] selftest: mptcp: exit from copyfd_io_poll() when receive SIGUSR1
Date: Thu, 3 Nov 2022 19:06:48 +0800 [thread overview]
Message-ID: <20221103110649.299284-4-imagedong@tencent.com> (raw)
In-Reply-To: <20221103110649.299284-1-imagedong@tencent.com>
From: Menglong Dong <imagedong@tencent.com>
For now, mptcp_connect won't exit after receiving the 'SIGUSR1' signal
if '-r' is set. Fix this by skipping poll and sleep in copyfd_io_poll()
if 'quit' is set.
Signed-off-by: Menglong Dong <imagedong@tencent.com>
---
tools/testing/selftests/net/mptcp/mptcp_connect.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/testing/selftests/net/mptcp/mptcp_connect.c b/tools/testing/selftests/net/mptcp/mptcp_connect.c
index e54653ea2ed4..518c6d653c0e 100644
--- a/tools/testing/selftests/net/mptcp/mptcp_connect.c
+++ b/tools/testing/selftests/net/mptcp/mptcp_connect.c
@@ -586,7 +586,7 @@ static int copyfd_io_poll(int infd, int peerfd, int outfd, bool *in_closed_after
char rbuf[8192];
ssize_t len;
- if (fds.events == 0)
+ if (fds.events == 0 || quit)
break;
switch (poll(&fds, 1, poll_timeout)) {
@@ -692,7 +692,7 @@ static int copyfd_io_poll(int infd, int peerfd, int outfd, bool *in_closed_after
}
/* leave some time for late join/announce */
- if (cfg_remove)
+ if (cfg_remove && !quit)
usleep(cfg_wait);
return 0;
--
2.37.2
next prev parent reply other threads:[~2022-11-03 11:07 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-03 11:06 [PATCH mptcp-next v6 0/4] mptcp: add statistics for mptcp socket in use menglong8.dong
2022-11-03 11:06 ` [PATCH mptcp-next v6 1/4] mptcp: introduce 'sk' to replace 'sock->sk' in mptcp_listen() menglong8.dong
2022-11-03 11:06 ` [PATCH mptcp-next v6 2/4] mptcp: add statistics for mptcp socket in use menglong8.dong
2022-11-03 11:06 ` menglong8.dong [this message]
2022-11-03 11:06 ` [PATCH mptcp-next v6 4/4] selftest: mptcp: add test " menglong8.dong
2022-11-03 13:21 ` selftest: mptcp: add test for mptcp socket in use: Tests Results MPTCP CI
2022-11-03 17:34 ` Matthieu Baerts
2022-11-04 0:04 ` Mat Martineau
2022-11-04 2:58 ` [Internet]Re: " imagedong(董梦龙)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221103110649.299284-4-imagedong@tencent.com \
--to=menglong8.dong@gmail.com \
--cc=imagedong@tencent.com \
--cc=mathew.j.martineau@linux.intel.com \
--cc=matthieu.baerts@tessares.net \
--cc=mptcp@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox