summaryrefslogtreecommitdiffstats
path: root/src/random-seed
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2019-07-22 10:24:26 +0200
committerLennart Poettering <lennart@poettering.net>2019-07-25 18:20:50 +0200
commit15d961bf537435914736005a857b33750b13848b (patch)
tree5f40a5cee268e7d609ac23f7648d70899e5c3ea7 /src/random-seed
parentunits: automatically initialize the system token if that makes sense (diff)
downloadsystemd-15d961bf537435914736005a857b33750b13848b.tar.xz
systemd-15d961bf537435914736005a857b33750b13848b.zip
random-seed: reduce scope of variable
Diffstat (limited to 'src/random-seed')
-rw-r--r--src/random-seed/random-seed.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/random-seed/random-seed.c b/src/random-seed/random-seed.c
index 12f14f2888..1a1ce8caa4 100644
--- a/src/random-seed/random-seed.c
+++ b/src/random-seed/random-seed.c
@@ -46,11 +46,11 @@ static int run(int argc, char *argv[]) {
* new data, to make sure the next boot gets seeded differently. */
if (streq(argv[1], "load")) {
- int open_rw_error;
seed_fd = open(RANDOM_SEED, O_RDWR|O_CLOEXEC|O_NOCTTY|O_CREAT, 0600);
- open_rw_error = -errno;
if (seed_fd < 0) {
+ int open_rw_error = -errno;
+
write_seed_file = false;
seed_fd = open(RANDOM_SEED, O_RDONLY|O_CLOEXEC|O_NOCTTY);