diff mbox series

[mptcp-next] Squash to "selftests/bpf: Add mptcp subflow subtest"

Message ID 20240910152907.2538-2-matttbe@kernel.org (mailing list archive)
State Accepted, archived
Delegated to: Matthieu Baerts
Headers show
Series [mptcp-next] Squash to "selftests/bpf: Add mptcp subflow subtest" | expand

Commit Message

Matthieu Baerts (NGI0) Sept. 10, 2024, 3:29 p.m. UTC
Fix sleep() usage: sleep() takes an integer, not a float/double.

  tools/testing/selftests/bpf/prog_tests/mptcp.c:373:9: error: implicit conversion from 'double' to 'unsigned int' changes value from 0.1 to 0 [-Werror,-Wliteral-conversion]
    373 |                 sleep(0.1);
        |                 ~~~~~ ^~~

Use usleep() instead.

Link: https://github.com/kernel-patches/bpf/actions/runs/10794529238/job/29939101033
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
 tools/testing/selftests/bpf/prog_tests/mptcp.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/tools/testing/selftests/bpf/prog_tests/mptcp.c b/tools/testing/selftests/bpf/prog_tests/mptcp.c
index c30f032edaca..c76a0d8c8f93 100644
--- a/tools/testing/selftests/bpf/prog_tests/mptcp.c
+++ b/tools/testing/selftests/bpf/prog_tests/mptcp.c
@@ -5,6 +5,7 @@ 
 #include <linux/const.h>
 #include <netinet/in.h>
 #include <test_progs.h>
+#include <unistd.h>
 #include "cgroup_helpers.h"
 #include "network_helpers.h"
 #include "mptcp_sock.skel.h"
@@ -370,7 +371,7 @@  static void wait_for_new_subflows(int fd)
 		if (!err && subflows > 0)
 			break;
 
-		sleep(0.1);
+		usleep(100000); /* 0.1s */
 	}
 }