chiark
/
gitweb
/
~mdw
/
mLib
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Bug fixes: restore signals to their default dispositions, and set up the
[mLib]
/
bres.c
diff --git
a/bres.c
b/bres.c
index a1d2c544816ff4191a30b34c6474852aabe3392e..18170093b13cbfca3b8340366f878b90d1f396f9 100644
(file)
--- a/
bres.c
+++ b/
bres.c
@@
-1,6
+1,6
@@
/* -*-c-*-
*
/* -*-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
*
*
* Background reverse name resolution
*
@@
-30,6
+30,10
@@
/*----- Revision history --------------------------------------------------*
*
* $Log: bres.c,v $
/*----- 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
* 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++) {
if (doread(fd, a, hsk.naddr * hsk.addrsz))
goto tidy_2;
for (i = 0; i < hsk.naddr; i++) {
- struct in_addr in;
*p++ = a;
*p++ = a;
-
memcpy(&in, a, sizeof(in))
;
+
a += hsk.addrsz
;
}
*p++ = 0;
}
*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 (;;) {
/* --- Main request/response loop --- */
for (;;) {