X-Git-Url: https://git.distorted.org.uk/~mdw/adns/blobdiff_plain/6f2c243f115bd079373c959476ac4f46e8a31e91..87e46054b4db54320b42bd44da7d7267f06c1ae0:/src/internal.h?ds=inline diff --git a/src/internal.h b/src/internal.h index 5e42ade..9a5f23d 100644 --- a/src/internal.h +++ b/src/internal.h @@ -31,6 +31,7 @@ typedef unsigned char byte; #include #include #include +#include #include @@ -249,6 +250,8 @@ struct adns__state { int nservers, nsortlist, tcpserver; enum adns__tcpstate { server_disconnected, server_connecting, server_ok } tcpstate; struct timeval tcptimeout; + struct sigaction stdsigpipe; + sigset_t stdsigmask; struct server { struct in_addr addr; } servers[MAXSERVERS]; @@ -302,7 +305,15 @@ void adns__isort(void *array, int nobjs, int sz, void *tempbuf, * sz bytes long. needswap should return !0 if a>b (strictly, ie * wrong order) 0 if a<=b (ie, order is fine). */ - + +void adns__sigpipe_protect(adns_state); +void adns__sigpipe_unprotect(adns_state); +/* If SIGPIPE protection is not disabled, will block all signals except + * SIGPIPE, and set SIGPIPE's disposition to SIG_IGN. (And then restore.) + * Each call to _protect must be followed by a call to _unprotect before + * any significant amount of code gets to run. + */ + /* From transmit.c: */ adns_status adns__mkquery(adns_state ads, vbuf *vb, int *id_r,