From 364308dc05c3c6c121a4a0ff97fff39c0ded8697 Mon Sep 17 00:00:00 2001 Message-Id: <364308dc05c3c6c121a4a0ff97fff39c0ded8697.1714832336.git.mdw@distorted.org.uk> From: Mark Wooding Date: Sat, 3 Feb 2001 16:21:08 +0000 Subject: [PATCH] Bug fixes: restore signals to their default dispositions, and set up the addresses properly when unpacking @hostent@ structures. Organization: Straylight/Edgeware From: mdw --- bres.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) 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 (;;) { -- [mdw]