From: Rafał Miłecki Date: Wed, 3 Jan 2018 10:31:21 +0000 (+0100) Subject: mount: call hotplug mount scripts only on success X-Git-Url: https://git.librecmc.org/?p=oweals%2Fmountd.git;a=commitdiff_plain;h=0f4f20ba5ce2dc24914c231eb2984d40b30d2adb mount: call hotplug mount scripts only on success 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 --- 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); } }