mount: drop duplicated unlink() call from the mount_dev_del()
authorRafał Miłecki <rafal@milecki.pl>
Mon, 12 Feb 2018 11:01:52 +0000 (12:01 +0100)
committerRafał Miłecki <rafal@milecki.pl>
Fri, 16 Feb 2018 09:55:36 +0000 (10:55 +0100)
There is no need to call unlink() there as mount_enum_drives() does it
too, soon after calling mount_dev_del(). Also mount_enum_drives() does
that for STATUS_EXPIRED - which is expected - as there is no unlink()
call when device expires.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
mount.c

diff --git a/mount.c b/mount.c
index f196791b821f9edfcadf6cac5a2d162f0f99c696..aa346fff96abac9da6da8766e3f4767ab06e505b 100644 (file)
--- a/mount.c
+++ b/mount.c
@@ -591,8 +591,6 @@ static void mount_dev_del(struct mount *mount)
                log_printf("device %s has disappeared ... unmounting %s\n", mount->dev, tmp);
                system_printf("/bin/umount %s", tmp);
                rmdir(tmp);
-               snprintf(tmp, 64, "%s%s", uci_path, mount->name);
-               unlink(tmp);
                mount_dump_uci_state();
        }
 }