[LEDE-DEV] [PATCH mountd 1/3] mount: call hotplug mount scripts only on success

Rafał Miłecki zajec5 at gmail.com
Wed Jan 3 02:31:21 PST 2018


From: Rafał Miłecki <rafal at milecki.pl>

If mounting fails for whatever reason (like unsupported file system or
something) hotplug.d scripts shouldn't be called.

Signed-off-by: Rafał Miłecki <rafal at milecki.pl>
---
 mount.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mount.c b/mount.c
index caf9d9d..803acc1 100644
--- a/mount.c
+++ b/mount.c
@@ -160,8 +160,8 @@ static void mount_add_list(char *name, char *dev, char *serial,
 		snprintf(tmp, 64, "%s%s", uci_path, name);
 		snprintf(tmp2, 64, "/tmp/run/mountd/%s", dev);
 		symlink(tmp2, tmp);
-		mount_new("/tmp/run/mountd/", dev);
-		system_printf("ACTION=add DEVICE=%s NAME=%s /sbin/hotplug-call mount", dev, name);
+		if (!mount_new("/tmp/run/mountd/", dev))
+			system_printf("ACTION=add DEVICE=%s NAME=%s /sbin/hotplug-call mount", dev, name);
 	}
 }
 
-- 
2.11.0




More information about the Lede-dev mailing list