aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/libevent/arc4random.c
diff options
context:
space:
mode:
authorthegeorg <thegeorg@yandex-team.ru>2022-02-10 16:45:12 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:45:12 +0300
commit49116032d905455a7b1c994e4a696afc885c1e71 (patch)
treebe835aa92c6248212e705f25388ebafcf84bc7a1 /contrib/libs/libevent/arc4random.c
parent4e839db24a3bbc9f1c610c43d6faaaa99824dcca (diff)
downloadydb-49116032d905455a7b1c994e4a696afc885c1e71.tar.gz
Restoring authorship annotation for <thegeorg@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'contrib/libs/libevent/arc4random.c')
-rw-r--r--contrib/libs/libevent/arc4random.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/contrib/libs/libevent/arc4random.c b/contrib/libs/libevent/arc4random.c
index e6c5de6de1..8729f6b92f 100644
--- a/contrib/libs/libevent/arc4random.c
+++ b/contrib/libs/libevent/arc4random.c
@@ -63,10 +63,10 @@
#ifdef EVENT__HAVE_SYS_SYSCTL_H
#include <sys/sysctl.h>
#endif
-#ifdef EVENT__HAVE_SYS_RANDOM_H
-#include <sys/random.h>
+#ifdef EVENT__HAVE_SYS_RANDOM_H
+#include <sys/random.h>
+#endif
#endif
-#endif
#include <limits.h>
#include <stdlib.h>
#include <string.h>
@@ -170,10 +170,10 @@ arc4_seed_win32(void)
}
#endif
-#if defined(EVENT__HAVE_GETRANDOM)
-#define TRY_SEED_GETRANDOM
+#if defined(EVENT__HAVE_GETRANDOM)
+#define TRY_SEED_GETRANDOM
static int
-arc4_seed_getrandom(void)
+arc4_seed_getrandom(void)
{
unsigned char buf[ADD_ENTROPY];
size_t len, n;
@@ -185,7 +185,7 @@ arc4_seed_getrandom(void)
for (len = 0; len < sizeof(buf); len += n) {
n = sizeof(buf) - len;
- if (0 == getrandom(&buf[len], n, 0))
+ if (0 == getrandom(&buf[len], n, 0))
return -1;
}
/* make sure that the buffer actually got set. */
@@ -199,9 +199,9 @@ arc4_seed_getrandom(void)
evutil_memclear_(buf, sizeof(buf));
return 0;
}
-#endif /* EVENT__HAVE_GETRANDOM */
+#endif /* EVENT__HAVE_GETRANDOM */
-#if defined(EVENT__HAVE_SYS_SYSCTL_H) && defined(EVENT__HAVE_SYSCTL)
+#if defined(EVENT__HAVE_SYS_SYSCTL_H) && defined(EVENT__HAVE_SYSCTL)
#if EVENT__HAVE_DECL_CTL_KERN && EVENT__HAVE_DECL_KERN_ARND
#define TRY_SEED_SYSCTL_BSD
static int
@@ -340,10 +340,10 @@ arc4_seed(void)
if (0 == arc4_seed_win32())
ok = 1;
#endif
-#ifdef TRY_SEED_GETRANDOM
- if (0 == arc4_seed_getrandom())
- ok = 1;
-#endif
+#ifdef TRY_SEED_GETRANDOM
+ if (0 == arc4_seed_getrandom())
+ ok = 1;
+#endif
#ifdef TRY_SEED_URANDOM
if (0 == arc4_seed_urandom())
ok = 1;