FS-6294 FS-6308 NetBSD support should work test and report back please.

This commit is contained in:
Brian West committed 2014-03-19 14:34:07 -05:00
1 parent b8f1a1779f
commit c4c0f38aab
8 files changed
+28 -14

No files matched your search

@@ -381,8 +381,8 @@ char const *append_escaped(su_strlst_t *l,
return NULL;
for (;*n; n++)
if (isupper(*n))
*n = tolower(*n);
if (isupper(*(const unsigned char *)n))
*n = tolower(*(const unsigned char *)n);
slen = strlen(s); elen = url_esclen(s, HNV_RESERVED);
+1 -1
View File
@@ -183,7 +183,7 @@ bm_memcasemem_study0(char const *needle, size_t nlen, bm_fwd_table_t *fwd)
fwd->table[i] = (unsigned char)nlen;
for (i = 0; i < nlen; i++) {
unsigned char n = tolower(needle[i]);
unsigned char n = tolower((const unsigned char)needle[i]);
fwd->table[n] = (unsigned char)(nlen - i - 1);
}
@@ -46,6 +46,17 @@
#include <sys/event.h>
/* INT_TO_UDATA() macros from https://github.com/libevent/libevent */
/* Some platforms apparently define the udata field of struct kevent as
* intptr_t, whereas others define it as void*. There doesn't seem to be an
* easy way to tell them apart via autoconf, so we need to use OS macros. */
#if defined(HAVE_INTTYPES_H) && !defined(__OpenBSD__) && !defined(__FreeBSD__) && !defined(__darwin__) && !defined(__APPLE__)
#define INT_TO_UDATA(x) ((intptr_t)(x))
#else
#define INT_TO_UDATA(x) ((void*)(intptr_t)(x))
#endif
#define SU_ENABLE_MULTISHOT_KQUEUE 1
#include <stdlib.h>
@@ -246,7 +257,7 @@ int su_kqueue_port_register(su_port_t *self,
i = ser->ser_id;
flags = (wait->events & SU_WAIT_IN) ? EV_ADD : EV_ADD | EV_DISABLE;
EV_SET(ev, wait->fd, EVFILT_READ, flags, 0, 0, (void *)(intptr_t)i);
EV_SET(ev, wait->fd, EVFILT_READ, flags, 0, 0, INT_TO_UDATA(i));
if (kevent(self->sup_kqueue, ev, 1, NULL, 0, NULL) == -1) {
SU_DEBUG_0(("kevent((%u, %s, %u, %p)) failed: %s\n",
wait->fd, "EVFILT_READ", flags, (void *)(intptr_t)i, strerror(errno)));
@@ -254,13 +265,13 @@ int su_kqueue_port_register(su_port_t *self,
}
flags = (wait->events & SU_WAIT_OUT) ? EV_ADD : EV_ADD | EV_DISABLE;
EV_SET(ev, wait->fd, EVFILT_WRITE, flags, 0, 0, (void *)(intptr_t)i);
EV_SET(ev, wait->fd, EVFILT_WRITE, flags, 0, 0, INT_TO_UDATA(i));
if (kevent(self->sup_kqueue, ev, 1, NULL, 0, NULL) == -1) {
int error = errno;
SU_DEBUG_0(("kevent((%u, %s, %u, %p)) failed: %s\n",
wait->fd, "EVFILT_WRITE", flags, (void *)(intptr_t)i, strerror(error)));
EV_SET(ev, wait->fd, EVFILT_READ, EV_DELETE, 0, 0, (void *)(intptr_t)i);
EV_SET(ev, wait->fd, EVFILT_READ, EV_DELETE, 0, 0, INT_TO_UDATA(i));
kevent(self->sup_kqueue, ev, 1, NULL, 0, NULL);
errno = error;
@@ -298,14 +309,14 @@ static int su_kqueue_port_deregister0(su_port_t *self, int i, int destroy_wait)
wait = ser->ser_wait;
EV_SET(ev, wait->fd, EVFILT_READ, EV_DELETE, 0, 0, (void *)(intptr_t)i);
EV_SET(ev, wait->fd, EVFILT_READ, EV_DELETE, 0, 0, INT_TO_UDATA(i));
if (kevent(self->sup_kqueue, ev, 1, NULL, 0, NULL) == -1) {
SU_DEBUG_0(("remove kevent((%u, %s, %s, %p)) failed: %s\n",
wait->fd, "EVFILT_READ", "EV_DELETE", (void *)(intptr_t)i,
strerror(errno)));
}
EV_SET(ev, wait->fd, EVFILT_WRITE, EV_DELETE, 0, 0, (void *)(intptr_t)i);
EV_SET(ev, wait->fd, EVFILT_WRITE, EV_DELETE, 0, 0, INT_TO_UDATA(i));
if (kevent(self->sup_kqueue, ev, 1, NULL, 0, NULL) == -1) {
SU_DEBUG_0(("remove kevent((%u, %s, %s, %p)) failed: %s\n",
wait->fd, "EVFILT_WRITE", "EV_DELETE", (void *)(intptr_t)i,
@@ -465,7 +476,7 @@ int su_kqueue_port_eventmask(su_port_t *self, int index, int socket, int events)
wait->events = events;
flags = (wait->events & SU_WAIT_IN) ? EV_ADD | EV_ENABLE : EV_ADD | EV_DISABLE;
EV_SET(ev, wait->fd, EVFILT_READ, flags, 0, 0, (void *)(intptr_t)index);
EV_SET(ev, wait->fd, EVFILT_READ, flags, 0, 0, INT_TO_UDATA(index));
if (kevent(self->sup_kqueue, ev, 1, NULL, 0, NULL) == -1) {
SU_DEBUG_0(("modify kevent((%u, %s, %s, %p)) failed: %s\n",
wait->fd, "EVFILT_READ",
@@ -474,7 +485,7 @@ int su_kqueue_port_eventmask(su_port_t *self, int index, int socket, int events)
}
flags = (wait->events & SU_WAIT_OUT) ? EV_ADD | EV_ENABLE : EV_ADD | EV_DISABLE;
EV_SET(ev, wait->fd, EVFILT_WRITE, flags, 0, 0, (void *)(intptr_t)index);
EV_SET(ev, wait->fd, EVFILT_WRITE, flags, 0, 0, INT_TO_UDATA(index));
if (kevent(self->sup_kqueue, ev, 1, NULL, 0, NULL) == -1) {
SU_DEBUG_0(("modify kevent((%u, %s, %s, %p)) failed: %s\n",
wait->fd, "EVFILT_WRITE",