summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-01-04 15:29:48 -0500
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-01-06 13:52:47 -0500
commit4f0eedb703848597d004da506b7636719892a958 (patch)
tree0d2ff857af27b848b542dc0729a2f3005a9a1b61
parentf93891f3ecaadd00134b478012527450e5bb5248 (diff)
core/mount: modernize style
-rw-r--r--src/core/mount.c27
1 files changed, 18 insertions, 9 deletions
diff --git a/src/core/mount.c b/src/core/mount.c
index f263d9b9d1..7cadd9fcb4 100644
--- a/src/core/mount.c
+++ b/src/core/mount.c
@@ -222,9 +222,11 @@ static int mount_add_swap_links(Mount *m) {
assert(m);
- LIST_FOREACH(units_by_type, other, UNIT(m)->manager->units_by_type[UNIT_SWAP])
- if ((r = swap_add_one_mount_link(SWAP(other), m)) < 0)
+ LIST_FOREACH(units_by_type, other, UNIT(m)->manager->units_by_type[UNIT_SWAP]) {
+ r = swap_add_one_mount_link(SWAP(other), m);
+ if (r < 0)
return r;
+ }
return 0;
}
@@ -235,9 +237,11 @@ static int mount_add_path_links(Mount *m) {
assert(m);
- LIST_FOREACH(units_by_type, other, UNIT(m)->manager->units_by_type[UNIT_PATH])
- if ((r = path_add_one_mount_link(PATH(other), m)) < 0)
+ LIST_FOREACH(units_by_type, other, UNIT(m)->manager->units_by_type[UNIT_PATH]) {
+ r = path_add_one_mount_link(PATH(other), m);
+ if (r < 0)
return r;
+ }
return 0;
}
@@ -248,9 +252,11 @@ static int mount_add_automount_links(Mount *m) {
assert(m);
- LIST_FOREACH(units_by_type, other, UNIT(m)->manager->units_by_type[UNIT_AUTOMOUNT])
- if ((r = automount_add_one_mount_link(AUTOMOUNT(other), m)) < 0)
+ LIST_FOREACH(units_by_type, other, UNIT(m)->manager->units_by_type[UNIT_AUTOMOUNT]) {
+ r = automount_add_one_mount_link(AUTOMOUNT(other), m);
+ if (r < 0)
return r;
+ }
return 0;
}
@@ -261,9 +267,11 @@ static int mount_add_socket_links(Mount *m) {
assert(m);
- LIST_FOREACH(units_by_type, other, UNIT(m)->manager->units_by_type[UNIT_SOCKET])
- if ((r = socket_add_one_mount_link(SOCKET(other), m)) < 0)
+ LIST_FOREACH(units_by_type, other, UNIT(m)->manager->units_by_type[UNIT_SOCKET]) {
+ r = socket_add_one_mount_link(SOCKET(other), m);
+ if (r < 0)
return r;
+ }
return 0;
}
@@ -1670,7 +1678,8 @@ void mount_fd_event(Manager *m, int events) {
* /proc/self/mountinfo file, which informs us about mounting
* table changes */
- if ((r = mount_load_proc_self_mountinfo(m, true)) < 0) {
+ r = mount_load_proc_self_mountinfo(m, true);
+ if (r < 0) {
log_error("Failed to reread /proc/self/mountinfo: %s", strerror(-r));
/* Reset flags, just in case, for later calls */