From dc496715835566b5a666f8395359d4f20f47ff2b Mon Sep 17 00:00:00 2001 From: gardners Date: Tue, 7 May 2013 14:42:47 +0930 Subject: [PATCH] take sleep() out of urandomdev(), since it just causes problems, and read() should block if there aren't bytes available yet. --- commandline.c | 2 ++ os.c | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/commandline.c b/commandline.c index 53df4ea8..b4de6331 100644 --- a/commandline.c +++ b/commandline.c @@ -2367,6 +2367,8 @@ struct cli_schema command_line_options[]={ "Interactive servald monitor interface."}, {app_crypt_test,{"test","crypt",NULL}, 0, "Run cryptography speed test"}, + {app_nonce_test,{"test","nonce",NULL}, 0, + "Run nonce generation test"}, {app_slip_test,{"test","slip","[--seed=]","[--duration=|--iterations=]",NULL}, 0, "Run serial encapsulation test"}, #ifdef HAVE_VOIPTEST diff --git a/os.c b/os.c index 31266b80..9376bcc9 100644 --- a/os.c +++ b/os.c @@ -113,7 +113,6 @@ int urandombytes(unsigned char *buf, unsigned long long len) if (errno==EBADF) urandomfd=-1; return -1; } - sleep(1); } else { tries = 0; buf += i;