]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
eloop: if we take a free event, add it to the main queue
authorRoy Marples <roy@marples.name>
Sun, 7 Jun 2020 22:39:46 +0000 (23:39 +0100)
committerRoy Marples <roy@marples.name>
Sun, 7 Jun 2020 22:39:46 +0000 (23:39 +0100)
Otherwise it goes into the ether....

src/eloop.c

index 39c43d9d8bf9e12e7f75086177de4092c3da3eeb..5abd0f866116fed37fc831efb0d1b1ce0cdf5433 100644 (file)
@@ -326,8 +326,8 @@ eloop_event_add_rw(struct eloop *eloop, int fd,
                        e = malloc(sizeof(*e));
                        if (e == NULL)
                                return -1;
-                       TAILQ_INSERT_HEAD(&eloop->events, e, next);
                }
+               TAILQ_INSERT_HEAD(&eloop->events, e, next);
                e->fd = fd;
                eloop->nevents++;
        }