Skip to content

Commit

Permalink
selftest: mptcp: exit from copyfd_io_poll() when receive SIGUSR1
Browse files Browse the repository at this point in the history
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.

Acked-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Menglong Dong <imagedong@tencent.com>
Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Menglong Dong authored and David S. Miller committed Jan 9, 2023
1 parent c558246 commit 4a753ca
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/testing/selftests/net/mptcp/mptcp_connect.c
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ static int copyfd_io_poll(int infd, int peerfd, int outfd,
char rbuf[8192];
ssize_t len;

if (fds.events == 0)
if (fds.events == 0 || quit)
break;

switch (poll(&fds, 1, poll_timeout)) {
Expand Down Expand Up @@ -733,7 +733,7 @@ static int copyfd_io_poll(int infd, int peerfd, int outfd,
}

/* leave some time for late join/announce */
if (cfg_remove)
if (cfg_remove && !quit)
usleep(cfg_wait);

return 0;
Expand Down

0 comments on commit 4a753ca

Please sign in to comment.