pkgsrc/net/adns/patches/patch-ac
2005-03-12 06:05:33 +00:00

38 lines
1.2 KiB
Text

$NetBSD: patch-ac,v 1.4 2005/03/12 06:05:33 tv Exp $
--- client/adnslogres.c.orig 2000-09-17 10:09:02.000000000 -0400
+++ client/adnslogres.c
@@ -186,9 +186,11 @@ static void proclog(FILE *inf, FILE *out
msg("%d in queue; checking %.*s", len,
head->rest-head->addr, guard_null(head->addr));
if (eof || len >= maxpending) {
+#ifdef HAVE_POLL
if (opts & OPT_POLL)
err= adns_wait_poll(adns, &head->query, &answer, NULL);
else
+#endif
err= adns_wait(adns, &head->query, &answer, NULL);
} else {
err= adns_check(adns, &head->query, &answer, NULL);
@@ -223,7 +225,9 @@ static void printhelp(FILE *file) {
fputs("usage: adnslogres [<options>] [<logfile>]\n"
" adnslogres --version|--help\n"
"options: -c <concurrency> set max number of outstanding queries\n"
+#ifdef HAVE_POLL
" -p use poll(2) instead of select(2)\n"
+#endif
" -d turn on debugging\n"
" -C <config> use instead of contents of resolv.conf\n",
stdout);
@@ -268,9 +272,11 @@ int main(int argc, char *argv[]) {
case 'd':
opts|= OPT_DEBUG;
break;
+#ifdef HAVE_POLL
case 'p':
opts|= OPT_POLL;
break;
+#endif
default:
usage();
}