Unbreak build on NetBSD current.

This commit is contained in:
joerg 2015-10-07 23:19:08 +00:00
parent 71682366c1
commit 69b561166a
3 changed files with 44 additions and 11 deletions

View file

@ -1,6 +1,7 @@
$NetBSD: distinfo,v 1.5 2012/09/16 04:33:43 dholland Exp $
$NetBSD: distinfo,v 1.6 2015/10/07 23:19:08 joerg Exp $
SHA1 (bitstir-0.2.tar.gz) = 867fc2b28805a71ca2f1e3e3337b3c906951e121
RMD160 (bitstir-0.2.tar.gz) = a34412882c2685acd4b6613fbfe8a6c9fa9ebcf1
Size (bitstir-0.2.tar.gz) = 6423 bytes
SHA1 (patch-bitstir_c) = d211b8598481091048597a638ad1538c2fc1a710
SHA1 (patch-bits-avail.c) = 0a121a5878f38cc9debdd644669a15f31ff5fb1c
SHA1 (patch-bitstir_c) = 80b743e9fd552f73586bb6e9046fcae58527d27b

View file

@ -0,0 +1,27 @@
$NetBSD: patch-bits-avail.c,v 1.1 2015/10/07 23:19:08 joerg Exp $
--- bits-avail.c.orig 2015-09-27 17:10:12.000000000 +0000
+++ bits-avail.c
@@ -23,14 +23,21 @@
* SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
*/
+#include <sys/param.h>
#include <fcntl.h>
#include <stdio.h>
#include <sys/ioctl.h>
#include <sys/rnd.h>
+#if __NetBSD_Version__ >= 799001000
+# include <sys/rndio.h>
+#endif
+#include <stdlib.h>
+#include <unistd.h>
#define RANDOM "/dev/random"
-main()
+int
+main(void)
{
int fd, result;
u_int32_t entropy;

View file

@ -1,4 +1,4 @@
$NetBSD: patch-bitstir_c,v 1.2 2012/09/16 04:33:43 dholland Exp $
$NetBSD: patch-bitstir_c,v 1.3 2015/10/07 23:19:08 joerg Exp $
Get gMaxEntropy and gCriticalEntropyThreshold from the kernel in the
approved way, including at tls@'s suggestion a fallback in case the
@ -6,26 +6,31 @@ reported threshold is 0.
Also, fix a couple C usage issues.
--- bitstir.c~ 2003-08-27 16:58:51.000000000 -0400
+++ bitstir.c 2012-09-16 00:27:33.000000000 -0400
@@ -40,11 +40,13 @@
--- bitstir.c.orig 2015-09-27 17:10:03.000000000 +0000
+++ bitstir.c
@@ -40,11 +40,18 @@
#include <sys/wait.h>
#include <syslog.h>
#include <unistd.h>
+#include <paths.h>
+#include <sha1.h>
+
+#include <sys/param.h>
+#if __NetBSD_Version__ >= 799001000
+# include <sys/rndio.h>
+#endif
const char gRequiredOS[] = "NetBSD";
-const char gRandomDevice[] = "/dev/random";
+const char gRandomDevice[] = _PATH_RANDOM;
-const long gMaxEntropy = RND_POOLBITS;
-const long gCriticalEntropyThreshold = RND_POOLBITS / 10;
+const char gRandomDevice[] = _PATH_RANDOM;
+long gMaxEntropy;
+long gCriticalEntropyThreshold;
const long gMaxPathLen = PATH_MAX;
long verbose_flag = 0;
@@ -76,8 +77,8 @@
@@ -76,8 +83,8 @@ struct search_dir *current_search_dir =
void parse_command_line_args (int argc, char *argv[]);
long entropy_available(const char *device);
@ -36,7 +41,7 @@ Also, fix a couple C usage issues.
void nullify_fd (int fd);
void exec_find (const char *directory);
void kill_process (pid_t pid);
@@ -88,9 +89,10 @@
@@ -88,9 +95,10 @@ void log_err (char *fmt, ... );
void check_os ();
int is_directory (const char *path);
void setup_find_executable ();
@ -48,7 +53,7 @@ Also, fix a couple C usage issues.
{
if( argc == 1 ) {
fprintf(stderr, "usage: %s [switches] --search-dir dir [--search-dir dir ...]\n",
@@ -120,6 +122,7 @@
@@ -120,6 +128,7 @@ main(int argc, char *argv[])
check_os();
}
setup_find_executable();
@ -56,7 +61,7 @@ Also, fix a couple C usage issues.
if( root_search_dir == (struct search_dir *) NULL ) {
log_err("No directory specified with --search-dir. Exiting.\n");
@@ -578,6 +582,31 @@
@@ -578,6 +587,31 @@ void setup_find_executable ()
}
}