diff mbox series

[LEDE-DEV,mountd,2/2] mount: drop duplicated rmdir() call from the mount_enum_drives()

Message ID 20180212110153.4432-2-zajec5@gmail.com
State Accepted
Delegated to: Rafał Miłecki
Headers show
Series [LEDE-DEV,mountd,1/2] mount: drop duplicated unlink() call from the mount_dev_del() | expand

Commit Message

Rafał Miłecki Feb. 12, 2018, 11:01 a.m. UTC
From: Rafał Miłecki <rafal@milecki.pl>

Call to rmdir() for the same path is already executed in the
mount_dev_del().

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
---
 mount.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/mount.c b/mount.c
index aa346ff..bf5fbfd 100644
--- a/mount.c
+++ b/mount.c
@@ -760,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);
 			}