aboutsummaryrefslogtreecommitdiff
path: root/contrib/bind9/lib/bind/isc
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/bind9/lib/bind/isc')
-rw-r--r--contrib/bind9/lib/bind/isc/ev_connects.c10
-rw-r--r--contrib/bind9/lib/bind/isc/eventlib.c9
-rw-r--r--contrib/bind9/lib/bind/isc/eventlib_p.h4
-rw-r--r--contrib/bind9/lib/bind/isc/heap.c8
-rw-r--r--contrib/bind9/lib/bind/isc/hex.c5
-rw-r--r--contrib/bind9/lib/bind/isc/memcluster.c9
6 files changed, 25 insertions, 20 deletions
diff --git a/contrib/bind9/lib/bind/isc/ev_connects.c b/contrib/bind9/lib/bind/isc/ev_connects.c
index 4b0dd2222a0f..b3873b72e83c 100644
--- a/contrib/bind9/lib/bind/isc/ev_connects.c
+++ b/contrib/bind9/lib/bind/isc/ev_connects.c
@@ -20,7 +20,7 @@
*/
#if !defined(LINT) && !defined(CODECENTER)
-static const char rcsid[] = "$Id: ev_connects.c,v 1.4.206.2 2005/07/08 04:52:54 marka Exp $";
+static const char rcsid[] = "$Id: ev_connects.c,v 1.4.206.3 2006/03/10 00:17:21 marka Exp $";
#endif
/* Import. */
@@ -69,7 +69,7 @@ evListen(evContext opaqueCtx, int fd, int maxconn,
OKNEW(new);
new->flags = EV_CONN_LISTEN;
- OK(mode = fcntl(fd, F_GETFL, NULL)); /* side effect: validate fd. */
+ OKFREE(mode = fcntl(fd, F_GETFL, NULL), new); /* side effect: validate fd. */
/*
* Remember the nonblocking status. We assume that either evSelectFD
* has not been done to this fd, or that if it has then the caller
@@ -80,13 +80,13 @@ evListen(evContext opaqueCtx, int fd, int maxconn,
if ((mode & PORT_NONBLOCK) == 0) {
#ifdef USE_FIONBIO_IOCTL
int on = 1;
- OK(ioctl(fd, FIONBIO, (char *)&on));
+ OKFREE(ioctl(fd, FIONBIO, (char *)&on), new);
#else
- OK(fcntl(fd, F_SETFL, mode | PORT_NONBLOCK));
+ OKFREE(fcntl(fd, F_SETFL, mode | PORT_NONBLOCK), new);
#endif
new->flags |= EV_CONN_BLOCK;
}
- OK(listen(fd, maxconn));
+ OKFREE(listen(fd, maxconn), new);
if (evSelectFD(opaqueCtx, fd, EV_READ, listener, new, &new->file) < 0){
int save = errno;
diff --git a/contrib/bind9/lib/bind/isc/eventlib.c b/contrib/bind9/lib/bind/isc/eventlib.c
index 77b14144b97b..11120ecadd5d 100644
--- a/contrib/bind9/lib/bind/isc/eventlib.c
+++ b/contrib/bind9/lib/bind/isc/eventlib.c
@@ -20,7 +20,7 @@
*/
#if !defined(LINT) && !defined(CODECENTER)
-static const char rcsid[] = "$Id: eventlib.c,v 1.2.2.1.4.5 2005/07/28 07:43:20 marka Exp $";
+static const char rcsid[] = "$Id: eventlib.c,v 1.2.2.1.4.6 2006/03/10 00:17:21 marka Exp $";
#endif
#include "port_before.h"
@@ -784,13 +784,10 @@ pselect(int nfds, void *rfds, void *wfds, void *efds,
pnfds = 0;
}
n = poll(fds, pnfds, polltimeout);
- /*
- * pselect() should return the total number of events on the file
- * desriptors, not just the count of fd:s with activity. Hence,
- * traverse the pollfds array and count the events.
- */
if (n > 0) {
int i, e;
+
+ INSIST(ctx != NULL);
for (e = 0, i = ctx->firstfd; i <= ctx->fdMax; i++) {
if (ctx->pollfds[i].fd < 0)
continue;
diff --git a/contrib/bind9/lib/bind/isc/eventlib_p.h b/contrib/bind9/lib/bind/isc/eventlib_p.h
index b95741d7aff3..5c45ab83f60f 100644
--- a/contrib/bind9/lib/bind/isc/eventlib_p.h
+++ b/contrib/bind9/lib/bind/isc/eventlib_p.h
@@ -18,7 +18,7 @@
/* eventlib_p.h - private interfaces for eventlib
* vix 09sep95 [initial]
*
- * $Id: eventlib_p.h,v 1.3.2.1.4.3 2005/07/28 07:43:20 marka Exp $
+ * $Id: eventlib_p.h,v 1.3.2.1.4.4 2006/03/10 00:17:21 marka Exp $
*/
#ifndef _EVENTLIB_P_H
@@ -45,6 +45,8 @@
#define EV_MASK_ALL (EV_READ | EV_WRITE | EV_EXCEPT)
#define EV_ERR(e) return (errno = (e), -1)
#define OK(x) if ((x) < 0) EV_ERR(errno); else (void)NULL
+#define OKFREE(x, y) if ((x) < 0) { FREE((y)); EV_ERR(errno); } \
+ else (void)NULL
#define NEW(p) if (((p) = memget(sizeof *(p))) != NULL) \
FILL(p); \
diff --git a/contrib/bind9/lib/bind/isc/heap.c b/contrib/bind9/lib/bind/isc/heap.c
index f63619f5688f..2faf6f5767f0 100644
--- a/contrib/bind9/lib/bind/isc/heap.c
+++ b/contrib/bind9/lib/bind/isc/heap.c
@@ -26,7 +26,7 @@
*/
#if !defined(LINT) && !defined(CODECENTER)
-static const char rcsid[] = "$Id: heap.c,v 1.1.206.1 2004/03/09 08:33:43 marka Exp $";
+static const char rcsid[] = "$Id: heap.c,v 1.1.206.2 2006/03/10 00:17:21 marka Exp $";
#endif /* not lint */
#include "port_before.h"
@@ -54,9 +54,13 @@ heap_new(heap_higher_priority_func higher_priority, heap_index_func index,
int array_size_increment) {
heap_context ctx;
+ if (higher_priority == NULL)
+ return (NULL);
+
ctx = (heap_context)malloc(sizeof (struct heap_context));
- if (ctx == NULL || higher_priority == NULL)
+ if (ctx == NULL)
return (NULL);
+
ctx->array_size = 0;
if (array_size_increment == 0)
ctx->array_size_increment = ARRAY_SIZE_INCREMENT;
diff --git a/contrib/bind9/lib/bind/isc/hex.c b/contrib/bind9/lib/bind/isc/hex.c
index c177ca0fa328..70312597c906 100644
--- a/contrib/bind9/lib/bind/isc/hex.c
+++ b/contrib/bind9/lib/bind/isc/hex.c
@@ -45,8 +45,9 @@ isc_gethexstring(unsigned char *buf, size_t len, int count, FILE *fp,
goto formerr;
/* comment */
if (c == ';') {
- while ((c = fgetc(fp)) != EOF && c != '\n')
- /* empty */
+ do {
+ c = fgetc(fp);
+ } while (c != EOF && c != '\n');
if (c == '\n' && *multiline)
continue;
goto formerr;
diff --git a/contrib/bind9/lib/bind/isc/memcluster.c b/contrib/bind9/lib/bind/isc/memcluster.c
index c5b7202817c5..886f51601e25 100644
--- a/contrib/bind9/lib/bind/isc/memcluster.c
+++ b/contrib/bind9/lib/bind/isc/memcluster.c
@@ -24,7 +24,7 @@
#if !defined(LINT) && !defined(CODECENTER)
-static const char rcsid[] = "$Id: memcluster.c,v 1.3.206.7 2005/10/11 00:48:15 marka Exp $";
+static const char rcsid[] = "$Id: memcluster.c,v 1.3.206.8 2006/08/30 23:35:06 marka Exp $";
#endif /* not lint */
#include "port_before.h"
@@ -399,7 +399,7 @@ __memput_record(void *mem, size_t size, const char *file, int line) {
p = (char *)e + sizeof *e + size;
memcpy(&fp, p, sizeof fp);
INSIST(fp == BACK_FENCEPOST);
- INSIST(((int)mem % 4) == 0);
+ INSIST(((u_long)mem % 4) == 0);
#ifdef MEMCLUSTER_RECORD
prev = NULL;
if (size == max_size || new_size >= max_size)
@@ -523,10 +523,11 @@ memstats(FILE *out) {
for (i = 1; i <= max_size; i++) {
if ((e = activelists[i]) != NULL)
while (e != NULL) {
- fprintf(out, "%s:%d %p:%d\n",
+ fprintf(out, "%s:%d %p:%lu\n",
e->file != NULL ? e->file :
"<UNKNOWN>", e->line,
- (char *)e + sizeof *e, e->size);
+ (char *)e + sizeof *e,
+ (u_long)e->size);
e = e->next;
}
}