X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fcore%2Fmachine-id-setup.c;h=8fedf69802fd10a96a3b5c29527a9b913aab1066;hp=ce6d8e02d05d50bf943dfee6c83e67ecb1d15cc3;hb=0a1beeb64207eaa88ab9236787b1cbc2f704ae14;hpb=b4d23205f238e06aaa31264628e20669e714acad diff --git a/src/core/machine-id-setup.c b/src/core/machine-id-setup.c index ce6d8e02d..8fedf6980 100644 --- a/src/core/machine-id-setup.c +++ b/src/core/machine-id-setup.c @@ -142,7 +142,7 @@ static int generate(char id[34], const char *root) { /* If that didn't work, generate a random machine id */ r = sd_id128_randomize(&buf); if (r < 0) { - log_error("Failed to open /dev/urandom: %s", strerror(-r)); + log_error_errno(-r, "Failed to open /dev/urandom: %m"); return r; } @@ -242,7 +242,7 @@ int machine_id_setup(const char *root) { r = write_string_file(run_machine_id, id); } if (r < 0) { - log_error("Cannot write %s: %s", run_machine_id, strerror(-r)); + log_error_errno(-r, "Cannot write %s: %m", run_machine_id); unlink(run_machine_id); return r; }