]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Restore sys/random.h inclusion for getentropy()
authorTaylor Yu <catalyst@torproject.org>
Mon, 7 May 2018 17:43:39 +0000 (12:43 -0500)
committerTaylor Yu <catalyst@torproject.org>
Mon, 7 May 2018 17:56:12 +0000 (12:56 -0500)
Code movement for the refactoring for ticket 24658 didn't copy the
inclusion of sys/random.h, which is needed to get a prototype for
getentropy() on macOS 10.12 Sierra.  It also didn't copy the inclusion
of sys/syscall.h, which might prevent the getrandom() syscall from
being properly detected.  Move these inclusions.  Bug not in any
released Tor.

src/common/crypto.c
src/common/crypto_rand.c

index e148878be053a0b69c436cad5467b90a76da2e32..052f31723b92d358fd833ebc13e0996ac1981ac4 100644 (file)
@@ -60,12 +60,6 @@ ENABLE_GCC_WARNING(redundant-decls)
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
-#ifdef HAVE_SYS_SYSCALL_H
-#include <sys/syscall.h>
-#endif
-#ifdef HAVE_SYS_RANDOM_H
-#include <sys/random.h>
-#endif
 
 #include "torlog.h"
 #include "torint.h"
index 5abf0b0968106a0b331a4a1bf5a237d78b42cf92..df2e2f65d37ee4e3e9de3a8e0967dc8b32c0cbe2 100644 (file)
@@ -55,6 +55,12 @@ ENABLE_GCC_WARNING(redundant-decls)
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
+#ifdef HAVE_SYS_SYSCALL_H
+#include <sys/syscall.h>
+#endif
+#ifdef HAVE_SYS_RANDOM_H
+#include <sys/random.h>
+#endif
 
 /**
  * How many bytes of entropy we add at once.