chiark / gitweb /
+ * New adns_if_logpid option (functionality suggested by Tony Finch).
authorian <ian>
Fri, 15 Oct 1999 16:55:00 +0000 (16:55 +0000)
committerian <ian>
Fri, 15 Oct 1999 16:55:00 +0000 (16:55 +0000)
@@ -10,6 +10,7 @@
   General improvements
+  * New adns_if_logpid option (functionality suggested by Tony Finch).

changelog
src/adns.h
src/general.c

index 351a0273771f3025209425d8cf3eea5811894308..148bf018f399df2793098e9e17b5e281825577c8 100644 (file)
--- a/changelog
+++ b/changelog
@@ -10,6 +10,7 @@ adns (0.6) unstable; urgency=medium
 
   General improvements
   * New fanftest test program from Tony Finch.
 
   General improvements
   * New fanftest test program from Tony Finch.
+  * New adns_if_logpid option (functionality suggested by Tony Finch).
 
  --
 
 
  --
 
index b8c5b0223d25407bebc9cc2f7375486084e15f90..726d94eda5c28667d02190b8b1e24868c202da1a 100644 (file)
@@ -78,6 +78,7 @@ typedef enum {
   adns_if_noerrprint=   0x0002, /* never print output to stderr (_debug overrides) */
   adns_if_noserverwarn= 0x0004, /* do not warn to stderr about duff nameservers etc */
   adns_if_debug=        0x0008, /* enable all output to stderr plus debug msgs */
   adns_if_noerrprint=   0x0002, /* never print output to stderr (_debug overrides) */
   adns_if_noserverwarn= 0x0004, /* do not warn to stderr about duff nameservers etc */
   adns_if_debug=        0x0008, /* enable all output to stderr plus debug msgs */
+  adns_if_logpid=       0x0080, /* include pid in diagnostic output */
   adns_if_noautosys=    0x0010, /* do not make syscalls at every opportunity */
   adns_if_eintr=        0x0020, /* allow _wait and _synchronous to return EINTR */
   adns_if_nosigpipe=    0x0040, /* applic has SIGPIPE set to SIG_IGN, do not protect */
   adns_if_noautosys=    0x0010, /* do not make syscalls at every opportunity */
   adns_if_eintr=        0x0020, /* allow _wait and _synchronous to return EINTR */
   adns_if_nosigpipe=    0x0040, /* applic has SIGPIPE set to SIG_IGN, do not protect */
index ae7cac0f2b06910c7ece07346208e42788a28e21..0168a4ae4ea252fb6fa8263b71f1a8e3e68a08f7 100644 (file)
@@ -27,6 +27,7 @@
  */
 
 #include <stdlib.h>
  */
 
 #include <stdlib.h>
+#include <unistd.h>
 
 #include <sys/types.h>
 #include <sys/socket.h>
 
 #include <sys/types.h>
 #include <sys/socket.h>
@@ -46,7 +47,11 @@ void adns__vdiag(adns_state ads, const char *pfx, adns_initflags prevent,
       (!(ads->iflags & adns_if_debug) && (!prevent || (ads->iflags & prevent))))
     return;
 
       (!(ads->iflags & adns_if_debug) && (!prevent || (ads->iflags & prevent))))
     return;
 
-  fprintf(ads->diagfile,"adns%s: ",pfx);
+  if (ads->iflags & adns_if_logpid) {
+    fprintf(ads->diagfile,"adns%s [%ld]: ",pfx,(long)getpid());
+  } else {
+    fprintf(ads->diagfile,"adns%s: ",pfx);
+  }
 
   vfprintf(ads->diagfile,fmt,al);
 
 
   vfprintf(ads->diagfile,fmt,al);