Skip to contentSkip to conversation

Squash to "selftests/bpf: Add mptcp subflow subtest"

PATCH New Matthieu Baerts (NGI0) 1 participant 1 message Sep 10, 2024

Subsystems (4)
lore
Share & tools
lore

Matthieu Baerts (NGI0)

author maintainer
#0 lore raw

PATCH 1/1 Squash to "selftests/bpf: Add mptcp subflow subtest"

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.

---
 tools/testing/selftests/bpf/prog_tests/mptcp.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tools/testing/selftests/bpf/prog_tests/mptcp.c +2 -1
index c30f032edaca..c76a0d8c8f93 100644
@@ -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 */
 	}
 }
 
Signature · 1 line
2.45.2