From: Nadav Har'El <n...@scylladb.com>
Committer: Nadav Har'El <n...@scylladb.com>
Branch: master

Fix compilation errors due to multiple sys/random.h

A previous patch added a <sys/random.h> in include/api, but this is the
third such file we have no - we also have bsd/sys/sys/random.h and
bsd/sys/cddl/compat/opensolaris/sys/random.h.

Some of the BSD files now get the one from include/api instead of the
intended one from bsd/sys, and fail to compile. We can disambiguate the
one from bsd/ by including <sys/sys/random.h>. In this patch we also
drastically reduce the number of places that needlessly include this
header file.

Signed-off-by: Nadav Har'El <n...@scylladb.com>

---
diff --git a/bsd/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c b/bsd/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c
--- a/bsd/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c
+++ b/bsd/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c
@@ -38,7 +38,6 @@
 #include <sys/stat.h>
 #include <sys/unistd.h>
 #include <sys/sunddi.h>
-#include <sys/random.h>
 #include <sys/policy.h>
 #include <sys/kcondvar.h>
 #include <sys/callb.h>
diff --git a/bsd/sys/dev/random/harvest.cc b/bsd/sys/dev/random/harvest.cc
--- a/bsd/sys/dev/random/harvest.cc
+++ b/bsd/sys/dev/random/harvest.cc
@@ -35,7 +35,6 @@ __FBSDID("$FreeBSD$");
 #include <sys/mutex.h>
 #include <sys/poll.h>
 #include <sys/queue.h>
-#include <sys/random.h>
 #include <sys/selinfo.h>
 #include <sys/syslog.h>
 #include <sys/systm.h>
diff --git a/bsd/sys/dev/random/live_entropy_sources.cc b/bsd/sys/dev/random/live_entropy_sources.cc
--- a/bsd/sys/dev/random/live_entropy_sources.cc
+++ b/bsd/sys/dev/random/live_entropy_sources.cc
@@ -33,7 +33,6 @@ __FBSDID("$FreeBSD$");
 #include <sys/lock.h>
 #include <sys/malloc.h>
 #include <sys/queue.h>
-#include <sys/random.h>
 #include <sys/selinfo.h>
 #include <sys/sx.h>
 #include <sys/sysctl.h>
diff --git a/bsd/sys/dev/random/random_harvestq.cc b/bsd/sys/dev/random/random_harvestq.cc
--- a/bsd/sys/dev/random/random_harvestq.cc
+++ b/bsd/sys/dev/random/random_harvestq.cc
@@ -43,7 +43,6 @@ __FBSDID("$FreeBSD$");
 #include <sys/lock.h>
 #include <sys/malloc.h>
 #include <sys/mutex.h>
-#include <sys/random.h>
 #include <sys/selinfo.h>
 #include <sys/sysctl.h>
 #include <sys/unistd.h>
diff --git a/bsd/sys/dev/random/randomdev.h b/bsd/sys/dev/random/randomdev.h
--- a/bsd/sys/dev/random/randomdev.h
+++ b/bsd/sys/dev/random/randomdev.h
@@ -30,7 +30,7 @@
 #define SYS_DEV_RANDOM_RANDOMDEV_H_INCLUDED

 #include <sys/selinfo.h>
-#include <sys/random.h>
+#include <sys/sys/random.h>
 #include <sys/param.h>

 /* This header contains only those definitions that are global
diff --git a/bsd/sys/dev/random/randomdev_soft.cc b/bsd/sys/dev/random/randomdev_soft.cc
--- a/bsd/sys/dev/random/randomdev_soft.cc
+++ b/bsd/sys/dev/random/randomdev_soft.cc
@@ -49,7 +49,6 @@ __FBSDID("$FreeBSD$");
 #include <sys/module.h>
 #include <sys/mutex.h>
 #include <sys/poll.h>
-#include <sys/random.h>
 #include <sys/selinfo.h>
 #include <sys/sysctl.h>
 #include <sys/uio.h>
diff --git a/bsd/sys/dev/random/randomdev_soft.h b/bsd/sys/dev/random/randomdev_soft.h
--- a/bsd/sys/dev/random/randomdev_soft.h
+++ b/bsd/sys/dev/random/randomdev_soft.h
@@ -29,6 +29,8 @@
 #ifndef SYS_DEV_RANDOM_RANDOMDEV_SOFT_H_INCLUDED
 #define SYS_DEV_RANDOM_RANDOMDEV_SOFT_H_INCLUDED

+#include <sys/sys/random.h>
+
 /* This header contains only those definitions that are global
  * and harvester-specific for the entropy processor
  */
diff --git a/bsd/sys/dev/random/yarrow.cc b/bsd/sys/dev/random/yarrow.cc
--- a/bsd/sys/dev/random/yarrow.cc
+++ b/bsd/sys/dev/random/yarrow.cc
@@ -33,7 +33,6 @@ __FBSDID("$FreeBSD$");
 #include <sys/lock.h>
 #include <sys/malloc.h>
 #include <sys/mutex.h>
-#include <sys/random.h>
 #include <sys/sysctl.h>
 #include <sys/systm.h>

--
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to