From: mdw Date: Sat, 3 Feb 2001 16:21:08 +0000 (+0000) Subject: Bug fixes: restore signals to their default dispositions, and set up the X-Git-Tag: 2.0.4~110 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/mLib/commitdiff_plain/364308dc05c3c6c121a4a0ff97fff39c0ded8697 Bug fixes: restore signals to their default dispositions, and set up the addresses properly when unpacking @hostent@ structures. --- diff --git a/bres.c b/bres.c index a1d2c54..1817009 100644 --- a/bres.c +++ b/bres.c @@ -1,6 +1,6 @@ /* -*-c-*- * - * $Id: bres.c,v 1.4 2000/08/15 17:35:02 mdw Exp $ + * $Id: bres.c,v 1.5 2001/02/03 16:21:08 mdw Exp $ * * Background reverse name resolution * @@ -30,6 +30,10 @@ /*----- Revision history --------------------------------------------------* * * $Log: bres.c,v $ + * Revision 1.5 2001/02/03 16:21:08 mdw + * Bug fixes: restore signals to their default dispositions, and set up the + * addresses properly when unpacking @hostent@ structures. + * * Revision 1.4 2000/08/15 17:35:02 mdw * (gethost, and others): Since @gethost@ actually uses @malloc@ rather * than @xmalloc@, it's wrong to use @xfree@ on the result. Fixed the code @@ -308,9 +312,8 @@ static struct hostent *gethost(int fd) if (doread(fd, a, hsk.naddr * hsk.addrsz)) goto tidy_2; for (i = 0; i < hsk.naddr; i++) { - struct in_addr in; *p++ = a; - memcpy(&in, a, sizeof(in)); + a += hsk.addrsz; } *p++ = 0; @@ -433,6 +436,12 @@ static void child(int rfd, int cfd) } } + signal(SIGTERM, SIG_DFL); + signal(SIGHUP, SIG_DFL); + signal(SIGQUIT, SIG_DFL); + signal(SIGALRM, SIG_DFL); + signal(SIGINT, SIG_DFL); + /* --- Main request/response loop --- */ for (;;) {