summaryrefslogtreecommitdiffstats
path: root/initd
diff options
context:
space:
mode:
authorJohn Crispin <blogic@openwrt.org>2014-11-01 23:23:47 +0100
committerJohn Crispin <blogic@openwrt.org>2014-11-05 16:23:20 +0100
commit9286d16672b26c9fe7cb9dbf827a43a910df5559 (patch)
tree49cf3334120735144d972f71d257a75c1cc1ecd1 /initd
parent6f52ef3cc9f01e952e7f32d10c7f8612e635e80c (diff)
downloadunitd-9286d16672b26c9fe7cb9dbf827a43a910df5559.tar
unitd-9286d16672b26c9fe7cb9dbf827a43a910df5559.zip
kmodloader takes longer than wdt timeout
on systms with slow flash the watchdog will trigger when a lot of modules are included in the image. Signed-off-by: John Crispin <blogic@openwrt.org>
Diffstat (limited to 'initd')
-rw-r--r--initd/init.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/initd/init.c b/initd/init.c
index d8490f8..0d201bc 100644
--- a/initd/init.c
+++ b/initd/init.c
@@ -99,10 +99,18 @@ main(int argc, char **argv)
ERROR("Failed to start kmodloader\n");
exit(-1);
}
- if (pid <= 0)
+ if (pid <= 0) {
ERROR("Failed to start kmodloader instance\n");
- else
- waitpid(pid, NULL, 0);
+ } else {
+ int i;
+
+ for (i = 0; i < 120; i++) {
+ if (waitpid(pid, NULL, WNOHANG) > 0)
+ break;
+ sleep(1);
+ watchdog_ping();
+ }
+ }
uloop_init();
preinit();
uloop_run();