From: Stephan Bosch Date: Fri, 10 Apr 2020 19:53:06 +0000 (+0200) Subject: master: test-auth-client - Avoid using sleep()/usleep(). X-Git-Tag: 2.3.13~605 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=03c5dbbd4b7c41e018bbbfa771ad7a670d6feae7;p=thirdparty%2Fdovecot%2Fcore.git master: test-auth-client - Avoid using sleep()/usleep(). --- diff --git a/src/master/test-auth-client.c b/src/master/test-auth-client.c index ec778c7dfd..41c5105a35 100644 --- a/src/master/test-auth-client.c +++ b/src/master/test-auth-client.c @@ -12,6 +12,7 @@ #include "istream-chain.h" #include "ostream.h" #include "time-util.h" +#include "sleep.h" #include "unlink-directory.h" #include "write-full.h" #include "connection.h" @@ -132,7 +133,7 @@ static void test_connection_refused(void) static void test_connection_timed_out_input(struct server_connection *conn) { - sleep(5); + i_sleep_intr_secs(5); server_connection_deinit(&conn); } @@ -1211,7 +1212,7 @@ test_run_client_server(test_client_init_t *client_test, i_close_fd(&fd_listen); /* wait for it to be killed; this way, valgrind will not object to this process going away inelegantly. */ - sleep(60); + i_sleep_intr_secs(60); exit(1); } if (fd_listen != -1) @@ -1225,7 +1226,7 @@ test_run_client_server(test_client_init_t *client_test, if (debug) i_debug("PID=%s", my_pid); - usleep(100000); /* wait a little for server setup */ + i_sleep_intr_msecs(100); /* wait a little for server setup */ ioloop = io_loop_create(); if (client_test())