aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2015-10-19 09:04:53 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2015-10-19 09:04:53 +0000
commit749899052a55a0000c217b6da648551a29c54bfe (patch)
treee56fba3c34c4529121b0248aedec0b1174ac0b5c
parent384c6f27bb91b332c263de25a0a510507ed523a9 (diff)
downloadmkinitfs-749899052a55a0000c217b6da648551a29c54bfe.tar.bz2
mkinitfs-749899052a55a0000c217b6da648551a29c54bfe.tar.xz
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.
-rw-r--r--nlplug-findfs.c8
1 files changed, 7 insertions, 1 deletions
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;