mount: call hotplug mount scripts only on success
[oweals/mountd.git] / mount.c
diff --git a/mount.c b/mount.c
index caf9d9d7abcce8935b973271e3208bcaf0603ff5..803acc1fa8c7b644da82fb4d1bdf3573d59cf9f1 100644 (file)
--- 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);
        }
 }