From 0f4f20ba5ce2dc24914c231eb2984d40b30d2adb Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Wed, 3 Jan 2018 11:31:21 +0100 Subject: [PATCH] mount: call hotplug mount scripts only on success MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- 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