[OpenWrt-Devel] [PATCH 3/7] procd: skip respawn in case device disappeared

Michael Heimpold mhei at heimpold.de
Tue Jan 1 18:44:55 EST 2019


Signed-off-by: Michael Heimpold <mhei at heimpold.de>
---
 inittab.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/inittab.c b/inittab.c
index b8552e9..18023f5 100644
--- a/inittab.c
+++ b/inittab.c
@@ -123,6 +123,11 @@ static void child_exit(struct uloop_process *proc, int ret)
 	DEBUG(4, "pid:%d, exitcode:%d\n", proc->pid, ret);
 	proc->pid = 0;
 
+	if (!dev_exist(a->id)) {
+		DEBUG(4, "Skipping respawn: device '%s' does not exist anymore\n", a->id);
+		return;
+	}
+
 	uloop_timeout_set(&a->tout, a->respawn);
 }
 
-- 
2.17.1


_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list