From 5d6282906baf52258c080872fdc53a311ff5db88 Mon Sep 17 00:00:00 2001 From: Michael Heimpold Date: Wed, 2 Jan 2019 00:44:55 +0100 Subject: [PATCH] procd: skip respawn in case device disappeared Signed-off-by: Michael Heimpold --- inittab.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/inittab.c b/inittab.c index 3175048..b67730c 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.25.1