summaryrefslogtreecommitdiff
path: root/src/random-seed/random-seed.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/random-seed/random-seed.c')
-rw-r--r--src/random-seed/random-seed.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/random-seed/random-seed.c b/src/random-seed/random-seed.c
index 1a1ce8caa4..dc148ebc86 100644
--- a/src/random-seed/random-seed.c
+++ b/src/random-seed/random-seed.c
@@ -67,13 +67,8 @@ static int run(int argc, char *argv[]) {
write_seed_file = true;
random_fd = open("/dev/urandom", O_RDWR|O_CLOEXEC|O_NOCTTY, 0600);
- if (random_fd < 0) {
- write_seed_file = false;
-
- random_fd = open("/dev/urandom", O_WRONLY|O_CLOEXEC|O_NOCTTY, 0600);
- if (random_fd < 0)
- return log_error_errno(errno, "Failed to open /dev/urandom: %m");
- }
+ if (random_fd < 0)
+ return log_error_errno(errno, "Failed to open /dev/urandom: %m");
read_seed_file = true;