prog, opt_port, 0, 0);
if (ret == 0) { /* no request yet */
if (retry) {
- sleep(1);
+ ossl_sleep(1000);
retry = 0;
continue;
}
if (kidpids[i] != 0)
(void)kill(kidpids[i], SIGTERM);
OPENSSL_free(kidpids);
- sleep(1);
+ ossl_sleep(1000);
exit(ret);
}
WCOREDUMP(status) ? " (core dumped)" :
# endif
"");
- sleep(1);
+ ossl_sleep(1000);
}
break;
} else if (errno != EINTR) {
switch (fpid = fork()) {
case -1: /* error */
/* System critically low on memory, pause and try again later */
- sleep(30);
+ ossl_sleep(30000);
break;
case 0: /* child */
OPENSSL_free(kidpids);
continue;
}
#endif
-#if !defined(OPENSSL_SYS_MSDOS)
- sleep(1);
-#endif
+ ossl_sleep(1000);
continue;
}
} else if (i == 0) { /* end of input */
continue;
}
#endif
-#if !defined(OPENSSL_SYS_MSDOS)
- sleep(1);
-#endif
+ ossl_sleep(1000);
continue;
}
} else if (i == 0) { /* end of input */
#include <errno.h>
#include <openssl/crypto.h>
#include "bio_local.h"
-#include "internal/cryptlib.h"
/*
* Helper macro for the callback to determine whether an operator expects a
#include "cmp_local.h"
#include "internal/cryptlib.h"
+#include "e_os.h" /* ossl_sleep() */
/* explicit #includes not strictly needed since implied by the above: */
#include <openssl/bio.h>
# endif
/* end vxworks */
+/* system-specific variants defining ossl_sleep() */
+#ifdef OPENSSL_SYS_UNIX
+# include <unistd.h>
+static ossl_inline void ossl_sleep(unsigned long millis)
+{
+# ifdef OPENSSL_SYS_VXWORKS
+ struct timespec ts;
+ ts.tv_sec = (long int) (millis / 1000);
+ ts.tv_nsec = (long int) (millis % 1000) * 1000000ul;
+ nanosleep(&ts, NULL);
+# elif defined(__TANDEM)
+# if !defined(_REENTRANT)
+# include <cextdecs.h(PROCESS_DELAY_)>
+ /* HPNS does not support usleep for non threaded apps */
+ PROCESS_DELAY_(millis * 1000);
+# elif defined(_SPT_MODEL_)
+# include <spthread.h>
+# include <spt_extensions.h>
+ usleep(millis * 1000);
+# else
+ usleep(millis * 1000);
+# endif
+# else
+ usleep(millis * 1000);
+# endif
+}
+#elif defined(_WIN32)
+# include <windows.h>
+static ossl_inline void ossl_sleep(unsigned long millis)
+{
+ Sleep(millis);
+}
+#else
+/* Fallback to a busy wait */
+static ossl_inline void ossl_sleep(unsigned long millis)
+{
+ struct timeval start, now;
+ unsigned long elapsedms;
+
+ gettimeofday(&start, NULL);
+ do {
+ gettimeofday(&now, NULL);
+ elapsedms = (((now.tv_sec - start.tv_sec) * 1000000)
+ + now.tv_usec - start.tv_usec) / 1000;
+ } while (elapsedms < millis);
+}
+#endif /* defined OPENSSL_SYS_UNIX */
+
/* ----------------------------- HP NonStop -------------------------------- */
/* Required to support platform variant without getpid() and pid_t. */
# if defined(__TANDEM) && defined(_GUARDIAN_TARGET)
int size, int (*cmp) (const void *, const void *),
int flags);
-/* system-specific variants defining ossl_sleep() */
-#ifdef OPENSSL_SYS_UNIX
-# include <unistd.h>
-static ossl_inline void ossl_sleep(unsigned long millis)
-{
-# ifdef OPENSSL_SYS_VXWORKS
- struct timespec ts;
- ts.tv_sec = (long int) (millis / 1000);
- ts.tv_nsec = (long int) (millis % 1000) * 1000000ul;
- nanosleep(&ts, NULL);
-# elif defined(__TANDEM)
-# if !defined(_REENTRANT)
-# include <cextdecs.h(PROCESS_DELAY_)>
- /* HPNS does not support usleep for non threaded apps */
- PROCESS_DELAY_(millis * 1000);
-# elif defined(_SPT_MODEL_)
-# include <spthread.h>
-# include <spt_extensions.h>
- usleep(millis * 1000);
-# else
- usleep(millis * 1000);
-# endif
-# else
- usleep(millis * 1000);
-# endif
-}
-#elif defined(_WIN32)
-# include <windows.h>
-static ossl_inline void ossl_sleep(unsigned long millis)
-{
- Sleep(millis);
-}
-#else
-/* Fallback to a busy wait */
-static ossl_inline void ossl_sleep(unsigned long millis)
-{
- struct timeval start, now;
- unsigned long elapsedms;
-
- gettimeofday(&start, NULL);
- do {
- gettimeofday(&now, NULL);
- elapsedms = (((now.tv_sec - start.tv_sec) * 1000000)
- + now.tv_usec - start.tv_usec) / 1000;
- } while (elapsedms < millis);
-}
-#endif /* defined OPENSSL_SYS_UNIX */
-
char *ossl_sk_ASN1_UTF8STRING2text(STACK_OF(ASN1_UTF8STRING) *text,
const char *sep, size_t max_len);
char *ossl_ipaddr_to_asc(unsigned char *p, int len);
#include <string.h>
#include "internal/nelem.h"
-#include "internal/cryptlib.h" /* for ossl_sleep() */
#include "ssltestlib.h"
#include "../testutil.h"
-#include "e_os.h"
+#include "e_os.h" /* for ossl_sleep() etc. */
#ifdef OPENSSL_SYS_UNIX
# include <unistd.h>