summaryrefslogtreecommitdiffstats
path: root/lib/libzpool/kernel.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libzpool/kernel.c')
-rw-r--r--lib/libzpool/kernel.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/libzpool/kernel.c b/lib/libzpool/kernel.c
index ca3578993..e96a1d752 100644
--- a/lib/libzpool/kernel.c
+++ b/lib/libzpool/kernel.c
@@ -723,15 +723,15 @@ lowbit64(uint64_t i)
return (__builtin_ffsll(i));
}
-char *random_path = "/dev/random";
-char *urandom_path = "/dev/urandom";
+const char *random_path = "/dev/random";
+const char *urandom_path = "/dev/urandom";
static int random_fd = -1, urandom_fd = -1;
void
random_init(void)
{
- VERIFY((random_fd = open(random_path, O_RDONLY)) != -1);
- VERIFY((urandom_fd = open(urandom_path, O_RDONLY)) != -1);
+ VERIFY((random_fd = open(random_path, O_RDONLY | O_CLOEXEC)) != -1);
+ VERIFY((urandom_fd = open(urandom_path, O_RDONLY | O_CLOEXEC)) != -1);
}
void