diff options
author | Rodrigo Arias Mallo <rodarima@gmail.com> | 2024-07-29 20:18:14 +0200 |
---|---|---|
committer | Rodrigo Arias Mallo <rodarima@gmail.com> | 2024-08-07 16:50:51 +0200 |
commit | 49ae3fd3edb957a8a2f7c7541c66b9336f25176e (patch) | |
tree | f77ceb37f996983fde3c2dc8811e201eaf634c02 | |
parent | 59c9094781cbf340f11929d497c1465cf45cf90a (diff) |
Use portable dUsleep() instead of usleep()
Reviewed-by: dogma
-rw-r--r-- | src/IO/dpi.c | 5 | ||||
-rw-r--r-- | test/unit/cookies.c | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/src/IO/dpi.c b/src/IO/dpi.c index c1786de6..46ddc49e 100644 --- a/src/IO/dpi.c +++ b/src/IO/dpi.c @@ -39,6 +39,7 @@ #include "IO.h" #include "Url.h" #include "../../dpip/dpip.h" +#include "dlib/dlib.h" /* This one is tricky, some sources state it should include the byte * for the terminating NULL, and others say it shouldn't. */ @@ -504,12 +505,12 @@ static int Dpi_check_dpid(int num_tries) static int Dpi_blocking_start_dpid(void) { int cst, try = 0, - n_tries = 3; /* 3 seconds */ + n_tries = 12; /* 3 seconds */ /* test the dpid, and wait a bit for it to start if necessary */ while ((cst = Dpi_check_dpid(n_tries)) == 1) { MSG("Dpi_blocking_start_dpid: try %d\n", ++try); - sleep(1); + dUsleep(250000UL); } return cst; } diff --git a/test/unit/cookies.c b/test/unit/cookies.c index ce122ffc..caef5d7b 100644 --- a/test/unit/cookies.c +++ b/test/unit/cookies.c @@ -277,12 +277,12 @@ static int Dpi_check_dpid(int num_tries) static int Dpi_blocking_start_dpid(void) { int cst, try = 0, - n_tries = 3; /* 3 seconds */ + n_tries = 12; /* 3 seconds */ /* test the dpid, and wait a bit for it to start if necessary */ while ((cst = Dpi_check_dpid(n_tries)) == 1) { MSG("Dpi_blocking_start_dpid: try %d\n", ++try); - sleep(1); /* 1/4 sec */ + dUsleep(250000U); /* 1/4 sec */ } return cst; } |