That function is called no matter if "m" variable is null or not. This
saves a one duplicated line & allows merging two conditional blocks
starting with if (m). It doesn't change code execution order.
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Reviewed-by: Michael Heimpold <mhei@heimpold.de>
if (m && m->extroot)
return -1;
+ if (type == TYPE_HOTPLUG)
+ blockd_notify(device, m, pr);
+
if (m) {
+ char *target = m->target;
+ char _target[32];
+ int err = 0;
+
switch (type) {
case TYPE_HOTPLUG:
- blockd_notify(device, m, pr);
if (m->autofs)
return 0;
if (!auto_mount)
return -1;
break;
}
- } else if (type == TYPE_HOTPLUG) {
- blockd_notify(device, NULL, pr);
- }
-
- if (m) {
- char *target = m->target;
- char _target[32];
- int err = 0;
if (m->autofs) {
snprintf(_target, sizeof(_target), "/tmp/run/blockd/%s", device);