$NetBSD: patch-ba,v 1.2 2002/02/24 12:25:41 veego Exp $ --- src/dnsserver.c.orig Fri Jan 12 01:51:47 2001 +++ src/dnsserver.c Sun Feb 24 12:44:12 2002 @@ -135,6 +135,7 @@ #if HAVE_RESOLV_H #include #endif +#include #include "util.h" #include "snprintf.h" @@ -258,8 +259,10 @@ { char request[512]; char *t = NULL; - int c; + int c, count = 0; +#if HAVE_RES_INIT int opt_s = 0; +#endif extern char *optarg; safe_inet_addr("255.255.255.255", &no_addr); @@ -333,6 +336,10 @@ } } +#if HAVE_SETPROCTITLE + setproctitle("(%d requests)", count); +#endif + for (;;) { memset(request, '\0', REQ_SZ); if (fgets(request, REQ_SZ, stdin) == NULL) @@ -345,6 +352,10 @@ *t = '\0'; /* strip CR */ lookup(request); fflush(stdout); +#if HAVE_SETPROCTITLE + count++; + setproctitle("(%d requests)", count); +#endif } /* NOTREACHED */ return 0;