chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
26febd4
)
random-seed: create parents of RANDOM_SEED if they do not exist.
author
Gustavo Sverzut Barbieri
<barbieri@profusion.mobi>
Mon, 20 Sep 2010 13:04:10 +0000
(10:04 -0300)
committer
Lennart Poettering
<lennart@poettering.net>
Mon, 20 Sep 2010 21:12:50 +0000
(23:12 +0200)
it may happen that parent directories of RANDOM_SEED do not exist, in
that case we must create it otherwise save will not work.
src/random-seed.c
patch
|
blob
|
history
diff --git
a/src/random-seed.c
b/src/random-seed.c
index 936ed4791b91548d573330fbe9997be32da21536..8eab2b4e1ce3d9f99f5a5c7be1bb1812e0d6ab30 100644
(file)
--- a/
src/random-seed.c
+++ b/
src/random-seed.c
@@
-61,6
+61,11
@@
int main(int argc, char *argv[]) {
goto finish;
}
+ if (mkdir_parents(RANDOM_SEED, 0755) < 0) {
+ log_error("Failed to create directories parents of %s: %m", RANDOM_SEED);
+ goto finish;
+ }
+
/* When we load the seed we read it and write it to the device
* and then immediately update the saved seed with new data,
* to make sure the next boot gets seeded differently. */