-/* $OpenBSD: resolvd.c,v 1.13 2021/07/16 15:22:12 florian Exp $ */
+/* $OpenBSD: resolvd.c,v 1.14 2021/07/17 03:31:31 kn Exp $ */
/*
* Copyright (c) 2021 Florian Obser <florian@openbsd.org>
* Copyright (c) 2021 Theo de Raadt <deraadt@openbsd.org>
enum {
KQ_ROUTE,
KQ_RESOLVE_CONF,
+#ifndef SMALL
KQ_UNWIND,
+#endif
+ KQ_TOTAL
};
int
struct timespec one = {1, 0};
int kq, ch, debug = 0, routesock;
int rtfilter, nready, lockfd;
- struct kevent kev[3];
+ struct kevent kev[KQ_TOTAL];
#ifndef SMALL
int unwindsock = -1;
#endif
newkevent = 0;
}
- nready = kevent(kq, NULL, 0, kev, nitems(kev), NULL);
+ nready = kevent(kq, NULL, 0, kev, KQ_TOTAL, NULL);
if (nready == -1) {
if (errno == EINTR)
continue;