Skip to content

Commit 4a753ca

Browse files
menglongdongdavem330
authored andcommitted
selftest: mptcp: exit from copyfd_io_poll() when receive SIGUSR1
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 <[email protected]> Signed-off-by: Menglong Dong <[email protected]> Signed-off-by: Mat Martineau <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent c558246 commit 4a753ca

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tools/testing/selftests/net/mptcp/mptcp_connect.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,7 @@ static int copyfd_io_poll(int infd, int peerfd, int outfd,
627627
char rbuf[8192];
628628
ssize_t len;
629629

630-
if (fds.events == 0)
630+
if (fds.events == 0 || quit)
631631
break;
632632

633633
switch (poll(&fds, 1, poll_timeout)) {
@@ -733,7 +733,7 @@ static int copyfd_io_poll(int infd, int peerfd, int outfd,
733733
}
734734

735735
/* leave some time for late join/announce */
736-
if (cfg_remove)
736+
if (cfg_remove && !quit)
737737
usleep(cfg_wait);
738738

739739
return 0;

0 commit comments

Comments
 (0)