Rename ossl_sleep calls to OSSL_sleep everywhere
authorRichard Levitte <levitte@openssl.org>
Mon, 3 Oct 2022 05:22:52 +0000 (07:22 +0200)
committerRichard Levitte <levitte@openssl.org>
Thu, 6 Oct 2022 06:01:09 +0000 (08:01 +0200)
Also, remove inclusions of internal/e_os.h where it seems no longer
necessary.

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/19330)

apps/cmp.c
apps/lib/http_server.c
apps/s_server.c
crypto/bio/bio_lib.c
crypto/cmp/cmp_client.c
test/helpers/ssltestlib.c

index bac54f1265896edac640a2b810e4b33c893d9149..24672144fe771ebaff51785434c48a337505940e 100644 (file)
@@ -2688,7 +2688,7 @@ static int cmp_server(OSSL_CMP_CTX *srv_cmp_ctx)
                                        prog, 0, 0);
         if (ret == 0) { /* no request yet */
             if (retry) {
-                ossl_sleep(1000);
+                OSSL_sleep(1000);
                 retry = 0;
                 continue;
             }
index 3f9f884c69e1698debf4f9f9fa23c9b04c492339..03afd715be377eafbb290ea3c88b04adf202a07a 100644 (file)
@@ -65,7 +65,7 @@ static void killall(int ret, pid_t *kidpids)
         if (kidpids[i] != 0)
             (void)kill(kidpids[i], SIGTERM);
     OPENSSL_free(kidpids);
-    ossl_sleep(1000);
+    OSSL_sleep(1000);
     exit(ret);
 }
 
@@ -141,7 +141,7 @@ void spawn_loop(const char *prog)
                                   "child process: %ld, term signal %d%s",
                                   (long)fpid, WTERMSIG(status), dumped);
                     }
-                    ossl_sleep(1000);
+                    OSSL_sleep(1000);
                 }
                 break;
             } else if (errno != EINTR) {
@@ -156,7 +156,7 @@ void spawn_loop(const char *prog)
         switch (fpid = fork()) {
         case -1: /* error */
             /* System critically low on memory, pause and try again later */
-            ossl_sleep(30000);
+            OSSL_sleep(30000);
             break;
         case 0: /* child */
             OPENSSL_free(kidpids);
index c04da1fc68bbea68b408b1f380079af6c613cc69..8a573d44146cbe82a76894287c40a6c1d11e5dee 100644 (file)
@@ -3184,7 +3184,7 @@ static int www_body(int s, int stype, int prot, unsigned char *context)
                     continue;
                 }
 #endif
-                ossl_sleep(1000);
+                OSSL_sleep(1000);
                 continue;
             }
         } else if (i == 0) {    /* end of input */
@@ -3625,7 +3625,7 @@ static int rev_body(int s, int stype, int prot, unsigned char *context)
                     continue;
                 }
 #endif
-                ossl_sleep(1000);
+                OSSL_sleep(1000);
                 continue;
             }
         } else if (i == 0) {    /* end of input */
index a0a83da8cb74d9f0fa5912e192ed851f795ab2ae..cceef45095c2e56049f4e322d71668fd8ffa5d28 100644 (file)
@@ -978,7 +978,7 @@ static int bio_wait(BIO *bio, time_t max_time, unsigned int nap_milliseconds)
         if ((unsigned long)sec_diff * 1000 < nap_milliseconds)
             nap_milliseconds = (unsigned int)sec_diff * 1000;
     }
-    ossl_sleep(nap_milliseconds);
+    OSSL_sleep(nap_milliseconds);
     return 1;
 }
 
index ec20af3aa1bf4effd72752ab105a63f5f3f4c013..26635db8501bc6ee7e7a5b946cb474bfff1cec17 100644 (file)
@@ -11,7 +11,6 @@
 
 #include "cmp_local.h"
 #include "internal/cryptlib.h"
-#include "internal/e_os.h" /* ossl_sleep() */
 
 /* explicit #includes not strictly needed since implied by the above: */
 #include <openssl/bio.h>
@@ -332,7 +331,7 @@ static int poll_for_response(OSSL_CMP_CTX *ctx, int sleep, int rid,
             OSSL_CMP_MSG_free(prep);
             prep = NULL;
             if (sleep) {
-                ossl_sleep((unsigned long)(1000 * check_after));
+                OSSL_sleep((unsigned long)(1000 * check_after));
             } else {
                 if (checkAfter != NULL)
                     *checkAfter = (int)check_after;
index 65077a2d1d866ec4045b1f8bd171c15aa0c2abd1..13564a08a71364f23fda5f7029b26d7776aa2d84 100644 (file)
@@ -12,7 +12,6 @@
 #include "internal/nelem.h"
 #include "ssltestlib.h"
 #include "../testutil.h"
-#include "internal/e_os.h" /* for ossl_sleep() etc. */
 
 #ifdef OPENSSL_SYS_UNIX
 # include <unistd.h>
@@ -1164,7 +1163,7 @@ int create_bare_ssl_connection(SSL *serverssl, SSL *clientssl, int want,
              * give the DTLS timer a chance to do something. We only do this for
              * the first few times to prevent hangs.
              */
-            ossl_sleep(50);
+            OSSL_sleep(50);
         }
     } while (retc <=0 || rets <= 0);