@@ -10,6 +10,7 @@
General improvements
+ * New adns_if_logpid option (functionality suggested by Tony Finch).
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).
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 */
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <sys/socket.h>
(!(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);