diff mbox

[OpenWrt-Devel,mountd,3/4] add hotplug events

Message ID 1465999824-20936-3-git-send-email-olivier.hardouin@gmail.com
State Changes Requested
Headers show

Commit Message

olivier.hardouin@gmail.com June 15, 2016, 2:10 p.m. UTC
add hotplug events (add, remove) to inform other subsystems
remove obsolete /etc/mountd/event call

Signed-off-by: Olivier Hardouin <olivier.hardouin@gmail.com>
---
 mount.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/mount.c b/mount.c
index aaddb70..219146b 100644
--- a/mount.c
+++ b/mount.c
@@ -161,6 +161,7 @@  static void mount_add_list(char *name, char *dev, char *serial,
 		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);
 	}
 }
 
@@ -734,7 +735,7 @@  static void mount_enum_drives(void)
 			log_printf("removing %s\n", q->dev);
 			snprintf(tmp, 64, "%s%s", uci_path, q->name);
 			unlink(tmp);
-			system_printf("/etc/mountd/event remove %s %s", q->dev, q->name);
+			system_printf("ACTION=remove DEVICE=%s NAME=%s /sbin/hotplug-call mount", q->dev, q->name);
 			free(q);
 			mount_dump_uci_state();
 			system_printf("/etc/fonstated/ReloadSamba");