summaryrefslogtreecommitdiff
path: root/src/gpt-auto-generator
diff options
context:
space:
mode:
authorMichal Schmidt <mschmidt@redhat.com>2014-11-28 18:23:20 +0100
committerMichal Schmidt <mschmidt@redhat.com>2014-11-28 18:24:30 +0100
commit23bbb0de4e3f85d9704a5c12a5afa2dfa0159e41 (patch)
tree28e66fb86dd0cffc3a3cca3cf234cb52c3b64ad3 /src/gpt-auto-generator
parent5e03c6e3b517286bbd65b48d88f60e5b83721894 (diff)
treewide: more log_*_errno + return simplifications
Diffstat (limited to 'src/gpt-auto-generator')
-rw-r--r--src/gpt-auto-generator/gpt-auto-generator.c25
1 files changed, 9 insertions, 16 deletions
diff --git a/src/gpt-auto-generator/gpt-auto-generator.c b/src/gpt-auto-generator/gpt-auto-generator.c
index 9803fca420..0e935b30b9 100644
--- a/src/gpt-auto-generator/gpt-auto-generator.c
+++ b/src/gpt-auto-generator/gpt-auto-generator.c
@@ -204,10 +204,8 @@ static int add_cryptsetup(const char *id, const char *what, bool rw, char **devi
"# Automatically generated by systemd-gpt-auto-generator\n\n"
"[Unit]\n"
"JobTimeoutSec=0\n"); /* the binary handles timeouts anyway */
- if (r < 0) {
- log_error_errno(r, "Failed to write device drop-in: %m");
- return r;
- }
+ if (r < 0)
+ return log_error_errno(r, "Failed to write device drop-in: %m");
ret = strappend("/dev/mapper/", id);
if (!ret)
@@ -487,10 +485,8 @@ static int enumerate_partitions(dev_t devnum) {
return log_oom();
r = udev_enumerate_scan_devices(e);
- if (r < 0) {
- log_error_errno(r, "Failed to enumerate partitions on %s: %m", node);
- return r;
- }
+ if (r < 0)
+ return log_error_errno(r, "Failed to enumerate partitions on %s: %m", node);
first = udev_enumerate_get_list_entry(e);
udev_list_entry_foreach(item, first) {
@@ -712,10 +708,8 @@ static int add_root_mount(void) {
if (r == -ENOENT) {
log_debug("EFI loader partition unknown, exiting.");
return 0;
- } else if (r < 0) {
- log_error_errno(r, "Failed to read ESP partition UUID: %m");
- return r;
- }
+ } else if (r < 0)
+ return log_error_errno(r, "Failed to read ESP partition UUID: %m");
/* OK, we have an ESP partition, this is fantastic, so let's
* wait for a root device to show up. A udev rule will create
@@ -739,10 +733,9 @@ static int add_mounts(void) {
int r;
r = get_block_device("/", &devno);
- if (r < 0) {
- log_error_errno(r, "Failed to determine block device of root file system: %m");
- return r;
- } else if (r == 0) {
+ if (r < 0)
+ return log_error_errno(r, "Failed to determine block device of root file system: %m");
+ else if (r == 0) {
log_debug("Root file system not on a (single) block device.");
return 0;
}