mount: drop duplicated rmdir() call from the mount_enum_drives()
[project/mountd.git] / mount.c
diff --git a/mount.c b/mount.c
index f196791..bf5fbfd 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();
        }
 }
@@ -762,11 +760,9 @@ static void mount_enum_drives(void)
                        p->prev->next = p->next;
                        p->next->prev = p->prev;
                        p = p->next;
-                       log_printf("removing %s\n", q->dev);
                        if (q->status == STATUS_MOUNTED || q->status == STATUS_EXPIRED) {
-                               snprintf(tmp, 64, "%s%s", "/tmp/run/mountd/", q->dev);
-                               rmdir(tmp);
                                snprintf(tmp, 64, "%s%s", uci_path, q->name);
+                               log_printf("unlinking %s\n", tmp);
                                unlink(tmp);
                                system_printf("ACTION=remove DEVICE=%s NAME=%s /sbin/hotplug-call mount", q->dev, q->name);
                        }