diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2023-06-01 01:31:25 +0200 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2023-06-22 08:33:56 +0200 |
commit | 4251512ea9f70c1a53a56252c4edaf0295473e1a (patch) | |
tree | 5e3dad49985df5c5bd4fd28d9bcb0cc5e0efbf39 /src/resolve | |
parent | test: check size detections by meson (diff) | |
download | systemd-4251512ea9f70c1a53a56252c4edaf0295473e1a.tar.xz systemd-4251512ea9f70c1a53a56252c4edaf0295473e1a.zip |
time-util: introduce usleep_safe()
We use usec_t for storing time value, which is 64bit.
However, usleep() takes useconds_t that is (typically?) 32bit.
Also, usleep() may only support the range [0, 1000000].
This introduce usleep_safe() which takes usec_t.
Diffstat (limited to 'src/resolve')
-rw-r--r-- | src/resolve/test-resolved-stream.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/resolve/test-resolved-stream.c b/src/resolve/test-resolved-stream.c index ae851f67f0..a52a225624 100644 --- a/src/resolve/test-resolved-stream.c +++ b/src/resolve/test-resolved-stream.c @@ -249,7 +249,7 @@ static void test_dns_stream(bool tls) { r = connect(clientfd, &server_address.sa, SOCKADDR_LEN(server_address)); if (r >= 0) break; - usleep(EVENT_TIMEOUT_USEC / 100); + usleep_safe(EVENT_TIMEOUT_USEC / 100); } assert_se(r >= 0); |