1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
$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 <resolv.h>
#endif
+#include <util.h>
#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;
|