$NetBSD: patch-ba,v 1.3 2002/10/13 16:43:22 taca Exp $ --- src/dnsserver.c.orig Mon Jul 1 17:55:46 2002 +++ src/dnsserver.c @@ -138,6 +138,9 @@ #if HAVE_RESOLV_H #include #endif +#if HAVE_UTIL_H +#include +#endif #include "util.h" #include "snprintf.h" @@ -263,6 +266,9 @@ main(int argc, char *argv[]) char *t = NULL; int c; int opt_s = 0; +#if HAVE_SETPROCTITLE + int count = 0; +#endif extern char *optarg; safe_inet_addr("255.255.255.255", &no_addr); @@ -336,6 +342,10 @@ main(int argc, char *argv[]) } } +#if HAVE_SETPROCTITLE + setproctitle("(no requests)"); +#endif + for (;;) { memset(request, '\0', REQ_SZ); if (fgets(request, REQ_SZ, stdin) == NULL) @@ -348,6 +358,10 @@ main(int argc, char *argv[]) *t = '\0'; /* strip CR */ lookup(request); fflush(stdout); +#if HAVE_SETPROCTITLE + count++; + setproctitle("(%d requests)", count); +#endif } /* NOTREACHED */ return 0;