summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafał Miłecki <rafal@milecki.pl>2018-11-30 14:09:20 +0100
committerRafał Miłecki <rafal@milecki.pl>2018-12-04 09:15:26 +0100
commitb86bd6ef92652014c8ae533c4878e7fb10757f46 (patch)
treedd46bf442b98fe6df83e941509cac74c4d2b6cdb
parente12c0d64a1446be30135954502a6f747b138e4e5 (diff)
downloadfstools-b86bd6ef92652014c8ae533c4878e7fb10757f46.tar.gz
block: fix formatting & indent in the mount_device()
There was some misformatted code that seemed like switch block having an else block. This improves code readability. Signed-off-by: Rafał Miłecki <rafal@milecki.pl> Reviewed-by: Michael Heimpold <mhei@heimpold.de>
-rw-r--r--block.c34
1 files changed, 18 insertions, 16 deletions
diff --git a/block.c b/block.c
index b01a633..d87251d 100644
--- a/block.c
+++ b/block.c
@@ -1021,22 +1021,24 @@ static int mount_device(struct probe_info *pr, int type)
if (m && m->extroot)
return -1;
- if (m) switch (type) {
- case TYPE_HOTPLUG:
- blockd_notify(device, m, pr);
- if (m->autofs)
- return 0;
- if (!auto_mount)
- return -1;
- break;
- case TYPE_AUTOFS:
- if (!m->autofs)
- return -1;
- break;
- case TYPE_DEV:
- if (m->autofs)
- return -1;
- break;
+ if (m) {
+ switch (type) {
+ case TYPE_HOTPLUG:
+ blockd_notify(device, m, pr);
+ if (m->autofs)
+ return 0;
+ if (!auto_mount)
+ return -1;
+ break;
+ case TYPE_AUTOFS:
+ if (!m->autofs)
+ return -1;
+ break;
+ case TYPE_DEV:
+ if (m->autofs)
+ return -1;
+ break;
+ }
} else if (type == TYPE_HOTPLUG) {
blockd_notify(device, NULL, pr);
}