From: ian Date: Fri, 15 Oct 1999 16:55:00 +0000 (+0000) Subject: @@ -10,6 +10,7 @@ X-Git-Tag: wip.base.getaddrinfo~231 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/adns/commitdiff_plain/a122e99d41be2e0f03311cf41e3eda4935238056 @@ -10,6 +10,7 @@ General improvements + * New adns_if_logpid option (functionality suggested by Tony Finch). --- diff --git a/changelog b/changelog index 351a027..148bf01 100644 --- a/changelog +++ b/changelog @@ -10,6 +10,7 @@ adns (0.6) unstable; urgency=medium General improvements * New fanftest test program from Tony Finch. + * New adns_if_logpid option (functionality suggested by Tony Finch). -- diff --git a/src/adns.h b/src/adns.h index 721fd11..0a2b6c8 100644 --- a/src/adns.h +++ b/src/adns.h @@ -51,7 +51,7 @@ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * - * $Id: adns.h,v 1.70 1999/10/13 01:23:56 ian Exp $ + * $Id: adns.h,v 1.71 1999/10/15 16:55:00 ian Exp $ */ #ifndef ADNS_H_INCLUDED @@ -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_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 */ diff --git a/src/general.c b/src/general.c index ae7cac0..0168a4a 100644 --- a/src/general.c +++ b/src/general.c @@ -27,6 +27,7 @@ */ #include +#include #include #include @@ -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; - 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);