summaryrefslogtreecommitdiff
path: root/src/gpt-auto-generator/gpt-auto-generator.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpt-auto-generator/gpt-auto-generator.c')
-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;
}