From 749899052a55a0000c217b6da648551a29c54bfe Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Mon, 19 Oct 2015 09:04:53 +0000 Subject: nlplug-findfs: make sure we handle all events in queue we want handle all the events in queue, even if we find the devices we are looking for. This is so we load kernel module for framebuffer even if the apkvol and bootrepo are found first. This means that the only valid exit condition is a poll timeout and that we can set the timeout to 0 once we found all the things we are looking for. --- nlplug-findfs.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'nlplug-findfs.c') diff --git a/nlplug-findfs.c b/nlplug-findfs.c index 4687c66..547fb76 100644 --- a/nlplug-findfs.c +++ b/nlplug-findfs.c @@ -693,7 +693,7 @@ int main(int argc, char *argv[]) pthread_create(&tid, NULL, trigger_thread, &fds[1].fd); trigger_running = 1; - while (trigger_running || !((found & FOUND_DEVICE) || ((found & FOUND_BOOTREPO) && (found & FOUND_APKOVL)))) { + while (1) { size_t len; struct iovec iov; char cbuf[CMSG_SPACE(sizeof(struct ucred))]; @@ -755,6 +755,12 @@ int main(int argc, char *argv[]) event_count++; found |= process_uevent(buf, len, &conf); + if ((found & FOUND_DEVICE) + || ((found & FOUND_BOOTREPO) && (found & FOUND_APKOVL))) { + dbg("setting timeout to 0"); + conf.timeout = 0; + } + if (fds[0].revents & POLLHUP) { dbg("parent hung up\n"); break; -- cgit v1.2.3