mirror of
https://github.com/AuxXxilium/eudev.git
synced 2025-01-13 23:45:07 +07:00
random-seed: create parents of RANDOM_SEED if they do not exist.
it may happen that parent directories of RANDOM_SEED do not exist, in that case we must create it otherwise save will not work.
This commit is contained in:
parent
26febd4590
commit
b56e57470c
@ -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. */
|
||||
|
Loading…
Reference in New Issue
Block a user