summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2017-12-19 10:02:27 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2017-12-19 15:20:38 +0100
commitd49a7143fcf5693f317d484ebbe92ecece99d086 (patch)
tree10d534c56784180af0c4f2d9a6a241c7ad9053ba /src
parent5364c68690d5a25b6dcc4b49534d88af78966f3b (diff)
downloadsystemd-d49a7143fcf5693f317d484ebbe92ecece99d086.tar.gz
machine-id-setup: use return log_error… pattern
No functional difference, but this way it's clearer that the original errno value is returned.
Diffstat (limited to 'src')
-rw-r--r--src/core/machine-id-setup.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/core/machine-id-setup.c b/src/core/machine-id-setup.c
index 767e97206c..1b7424800c 100644
--- a/src/core/machine-id-setup.c
+++ b/src/core/machine-id-setup.c
@@ -119,16 +119,15 @@ int machine_id_setup(const char *root, sd_id128_t machine_id, sd_id128_t *ret) {
fd = open(etc_machine_id, O_RDONLY|O_CLOEXEC|O_NOCTTY);
if (fd < 0) {
if (old_errno == EROFS && errno == ENOENT)
- log_error_errno(errno,
+ return log_error_errno(errno,
"System cannot boot: Missing /etc/machine-id and /etc is mounted read-only.\n"
"Booting up is supported only when:\n"
"1) /etc/machine-id exists and is populated.\n"
"2) /etc/machine-id exists and is empty.\n"
"3) /etc/machine-id is missing and /etc is writable.\n");
else
- log_error_errno(errno, "Cannot open %s: %m", etc_machine_id);
-
- return -errno;
+ return log_error_errno(errno,
+ "Cannot open %s: %m", etc_machine_id);
}
writable = false;