diff options
Diffstat (limited to 'devel')
-rw-r--r-- | devel/libevent/Makefile | 2 | ||||
-rw-r--r-- | devel/libevent/files/patch-configure.in | 27 | ||||
-rw-r--r-- | devel/libevent/files/patch-evdns.c | 52 | ||||
-rw-r--r-- | devel/libevent/files/patch-event.c | 26 | ||||
-rw-r--r-- | devel/libevent/files/patch-evutil.c | 11 | ||||
-rw-r--r-- | devel/libevent/files/patch-http.c | 20 | ||||
-rw-r--r-- | devel/libevent/files/patch-signal.c | 38 |
7 files changed, 175 insertions, 1 deletions
diff --git a/devel/libevent/Makefile b/devel/libevent/Makefile index 54aa11aed2fc..e782a85a7eb1 100644 --- a/devel/libevent/Makefile +++ b/devel/libevent/Makefile @@ -7,7 +7,7 @@ PORTNAME= libevent PORTVERSION= 1.4.14b -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= devel MASTER_SITES= http://monkey.org/~provos/ DISTNAME= ${PORTNAME}-${DISTVERSION}-stable diff --git a/devel/libevent/files/patch-configure.in b/devel/libevent/files/patch-configure.in new file mode 100644 index 000000000000..21f4600ae7a9 --- /dev/null +++ b/devel/libevent/files/patch-configure.in @@ -0,0 +1,27 @@ +--- configure.in.orig 2011-02-22 09:41:10.545704489 +0100 ++++ configure.in 2011-02-22 09:41:48.422499326 +0100 +@@ -6,6 +6,8 @@ + AM_CONFIG_HEADER(config.h) + dnl AM_MAINTAINER_MODE + ++AC_CONFIG_MACRO_DIR([m4]) ++ + AC_CANONICAL_HOST + + AC_DEFINE(NUMERIC_VERSION, 0x01040e00, [Numeric representation of the version]) +@@ -246,13 +248,14 @@ + if ((kq = kqueue()) == -1) + exit(1); + ++ memset(&ev, 0, sizeof(ev)); + ev.ident = fd[[1]]; + ev.filter = EVFILT_WRITE; + ev.flags = EV_ADD | EV_ENABLE; + n = kevent(kq, &ev, 1, NULL, 0, NULL); + if (n == -1) + exit(1); +- ++ + read(fd[[0]], buf, sizeof(buf)); + + ts.tv_sec = 0; diff --git a/devel/libevent/files/patch-evdns.c b/devel/libevent/files/patch-evdns.c new file mode 100644 index 000000000000..7ac2668f3773 --- /dev/null +++ b/devel/libevent/files/patch-evdns.c @@ -0,0 +1,52 @@ +--- evdns.c.orig 2011-02-22 09:47:55.243428037 +0100 ++++ evdns.c 2011-02-22 09:48:00.454027469 +0100 +@@ -158,6 +158,15 @@ + + #define CLASS_INET EVDNS_CLASS_INET + ++#ifdef HAVE_SETFD ++#define FD_CLOSEONEXEC(x) do { \ ++ if (fcntl(x, F_SETFD, 1) == -1) \ ++ event_warn("fcntl(%d, F_SETFD)", x); \ ++ } while (0) ++#else ++#define FD_CLOSEONEXEC(x) (void)0 ++#endif ++ + struct request { + u8 *request; /* the dns packet data */ + unsigned int request_len; +@@ -1099,20 +1108,12 @@ + static u16 + transaction_id_pick(void) { + for (;;) { +- const struct request *req = req_head, *started_at; + u16 trans_id = trans_id_function(); + + if (trans_id == 0xffff) continue; +- /* now check to see if that id is already inflight */ +- req = started_at = req_head; +- if (req) { +- do { +- if (req->trans_id == trans_id) break; +- req = req->next; +- } while (req != started_at); +- } +- /* we didn't find it, so this is a good id */ +- if (req == started_at) return trans_id; ++ ++ if (request_find_from_trans_id(trans_id) == NULL) ++ return trans_id; + } + } + +@@ -2132,7 +2133,8 @@ + + ns->socket = socket(PF_INET, SOCK_DGRAM, 0); + if (ns->socket < 0) { err = 1; goto out1; } +- evutil_make_socket_nonblocking(ns->socket); ++ FD_CLOSEONEXEC(ns->socket); ++ evutil_make_socket_nonblocking(ns->socket); + + ns->address = address; + ns->port = htons(port); diff --git a/devel/libevent/files/patch-event.c b/devel/libevent/files/patch-event.c new file mode 100644 index 000000000000..fda2586804ca --- /dev/null +++ b/devel/libevent/files/patch-event.c @@ -0,0 +1,26 @@ +--- event.c.orig 2011-02-22 09:41:20.016483538 +0100 ++++ event.c 2011-02-22 09:41:56.252380281 +0100 +@@ -279,9 +279,14 @@ + int res = 0; + struct event *ev; + ++#if 0 ++ /* Right now, reinit always takes effect, since even if the ++ backend doesn't require it, the signal socketpair code does. ++ */ + /* check if this event mechanism requires reinit */ + if (!evsel->need_reinit) + return (0); ++#endif + + /* prevent internal delete */ + if (base->sig.ev_signal_added) { +@@ -294,7 +299,7 @@ + EVLIST_ACTIVE); + base->sig.ev_signal_added = 0; + } +- ++ + if (base->evsel->dealloc != NULL) + base->evsel->dealloc(base, base->evbase); + evbase = base->evbase = evsel->init(base); diff --git a/devel/libevent/files/patch-evutil.c b/devel/libevent/files/patch-evutil.c new file mode 100644 index 000000000000..292d3987a616 --- /dev/null +++ b/devel/libevent/files/patch-evutil.c @@ -0,0 +1,11 @@ +--- evutil.c.orig 2011-02-22 09:39:26.529403997 +0100 ++++ evutil.c 2011-02-22 09:41:40.352952848 +0100 +@@ -169,7 +169,7 @@ + } + #else + { +- long flags; ++ int flags; + if ((flags = fcntl(fd, F_GETFL, NULL)) < 0) { + event_warn("fcntl(%d, F_GETFL)", fd); + return -1; diff --git a/devel/libevent/files/patch-http.c b/devel/libevent/files/patch-http.c new file mode 100644 index 000000000000..825910da8ea7 --- /dev/null +++ b/devel/libevent/files/patch-http.c @@ -0,0 +1,20 @@ +--- http.c.orig 2011-02-22 09:41:25.224559892 +0100 ++++ http.c 2011-02-22 09:42:00.208495705 +0100 +@@ -390,7 +398,7 @@ + /* Add the content length on a post request if missing */ + if (req->type == EVHTTP_REQ_POST && + evhttp_find_header(req->output_headers, "Content-Length") == NULL){ +- char size[12]; ++ char size[22]; + evutil_snprintf(size, sizeof(size), "%ld", + (long)EVBUFFER_LENGTH(req->output_buffer)); + evhttp_add_header(req->output_headers, "Content-Length", size); +@@ -447,7 +455,7 @@ + { + if (evhttp_find_header(headers, "Transfer-Encoding") == NULL && + evhttp_find_header(headers, "Content-Length") == NULL) { +- char len[12]; ++ char len[22]; + evutil_snprintf(len, sizeof(len), "%ld", content_length); + evhttp_add_header(headers, "Content-Length", len); + } diff --git a/devel/libevent/files/patch-signal.c b/devel/libevent/files/patch-signal.c new file mode 100644 index 000000000000..4b7301a3e5dc --- /dev/null +++ b/devel/libevent/files/patch-signal.c @@ -0,0 +1,38 @@ +--- signal.c.orig 2011-02-22 09:41:14.711661986 +0100 ++++ signal.c 2011-02-22 09:41:52.113522401 +0100 +@@ -67,6 +67,13 @@ + + static void evsignal_handler(int sig); + ++#ifdef WIN32 ++#define error_is_eagain(err) \ ++ ((err) == EAGAIN || (err) == WSAEWOULDBLOCK) ++#else ++#define error_is_eagain(err) ((err) == EAGAIN) ++#endif ++ + /* Callback for when the signal handler write a byte to our signaling socket */ + static void + evsignal_cb(int fd, short what, void *arg) +@@ -79,8 +86,11 @@ + #endif + + n = recv(fd, signals, sizeof(signals), 0); +- if (n == -1) +- event_err(1, "%s: read", __func__); ++ if (n == -1) { ++ int err = EVUTIL_SOCKET_ERROR(); ++ if (! error_is_eagain(err)) ++ event_err(1, "%s: read", __func__); ++ } + } + + #ifdef HAVE_SETFD +@@ -125,6 +135,7 @@ + TAILQ_INIT(&base->sig.evsigevents[i]); + + evutil_make_socket_nonblocking(base->sig.ev_signal_pair[0]); ++ evutil_make_socket_nonblocking(base->sig.ev_signal_pair[1]); + + event_set(&base->sig.ev_signal, base->sig.ev_signal_pair[1], + EV_READ | EV_PERSIST, evsignal_cb, &base->sig.ev_signal); |