procd: skip respawn in case device disappeared
authorMichael Heimpold <mhei@heimpold.de>
Tue, 1 Jan 2019 23:44:55 +0000 (00:44 +0100)
committerJohn Crispin <john@phrozen.org>
Sun, 27 Oct 2019 13:20:38 +0000 (14:20 +0100)
Signed-off-by: Michael Heimpold <mhei@heimpold.de>
inittab.c

index 3175048..b67730c 100644 (file)
--- 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);
 }