X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=adns.git;a=blobdiff_plain;f=regress%2Fhcommon.c;h=0aa3ffb05e58550310f050f708ed06ebc1b95602;hp=7aada144aed629c37d49df95de3da19cf666f141;hb=e7308d2612173a14b26f797ae3aca830859ea3bf;hpb=84ada014b1bf2cf7e5a38320be7371dbbf91bb23 diff --git a/regress/hcommon.c b/regress/hcommon.c index 7aada14..0aa3ffb 100644 --- a/regress/hcommon.c +++ b/regress/hcommon.c @@ -67,9 +67,12 @@ void Qpoll( const struct pollfd *fds , int nfds , int timeout ) { Q_vb(); } #endif -void Qsocket( int type ) { +void Qsocket( int domain , int type ) { vb.used= 0; Tvba("socket"); + Tvbf(domain==AF_INET ? " domain=AF_INET" : + domain==AF_INET6 ? " domain=AF_INET6" : + " domain=AF_???"); Tvbf(type==SOCK_STREAM ? " type=SOCK_STREAM" : " type=SOCK_DGRAM"); Q_vb(); } @@ -164,6 +167,10 @@ void Tvbbytes(const void *buf, int len) { void Tvbfdset(int max, const fd_set *fds) { int i; const char *comma= ""; + if (!fds) { + Tvba("null"); + return; + } Tvba("["); for (i=0; isz; } else { osz= 0; } np= Hmalloc(nsz); - memcpy(np,op, osz>nsz ? nsz : osz); + if (osz) memcpy(np,op, osz>nsz ? nsz : osz); Hfree(op); return np; } -void Hexit(int rv) { +void Texit(int rv) { struct malloced *loopnode; Tshutdown(); adns__vbuf_free(&vb); @@ -296,6 +303,12 @@ void Hexit(int rv) { } exit(rv); } +void Hexit(int rv) { + vb.used= 0; + Tvbf("exit %d", rv); + Q_vb(); + Texit(0); +} pid_t Hgetpid(void) { return 2264; /* just some number */ }