Using a set of 3 conditional block each setting "target" variable makes
code easier to follow.
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Reviewed-by: Michael Heimpold <mhei@heimpold.de>
blockd_notify(device, m, pr);
if (m) {
- char *target = m->target;
char _target[32];
+ char *target;
int err = 0;
switch (type) {
if (m->autofs) {
snprintf(_target, sizeof(_target), "/tmp/run/blockd/%s", device);
target = _target;
- }
- if (!target) {
+ } else if (m->target) {
+ target = m->target;
+ } else {
snprintf(_target, sizeof(_target), "/mnt/%s", device);
target = _target;
}