ports/devel/libevent/files/patch-test_bench
Jan Beich a9425224f1 devel/libevent2: drop historical suffix after r362796
PR:		216777
Approved by:	mm (maintainer)
2017-02-20 02:57:04 +00:00

75 lines
1.9 KiB
Text

Fix feature conditionals in bench tests.
https://github.com/libevent/libevent/commit/d9118c8daa0e
https://github.com/libevent/libevent/commit/77ec05e50dfe
--- configure.ac.orig 2017-01-25 23:37:15 UTC
+++ configure.ac
@@ -715,8 +715,7 @@ AC_CHECK_MEMBERS([struct in6_addr.s6_add
#endif
])
-AC_CHECK_TYPES([struct so_linger],
-[#define HAVE_SO_LINGER], ,
+AC_CHECK_TYPES([struct linger],,,
[
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
--- test/bench.c.orig 2017-01-25 23:37:15 UTC
+++ test/bench.c
@@ -136,7 +136,7 @@ run_once(void)
int
main(int argc, char **argv)
{
-#ifdef HAVE_SETRLIMIT
+#ifdef EVENT__HAVE_SETRLIMIT
struct rlimit rl;
#endif
int i, c;
@@ -167,7 +167,7 @@ main(int argc, char **argv)
}
}
-#ifdef HAVE_SETRLIMIT
+#ifdef EVENT__HAVE_SETRLIMIT
rl.rlim_cur = rl.rlim_max = num_pipes * 2 + 50;
if (setrlimit(RLIMIT_NOFILE, &rl) == -1) {
perror("setrlimit");
--- test/bench_cascade.c.orig 2017-01-25 23:37:15 UTC
+++ test/bench_cascade.c
@@ -139,7 +139,7 @@ run_once(int num_pipes)
int
main(int argc, char **argv)
{
-#ifdef HAVE_SETRLIMIT
+#ifdef EVENT__HAVE_SETRLIMIT
struct rlimit rl;
#endif
int i, c;
@@ -162,7 +162,7 @@ main(int argc, char **argv)
}
}
-#ifdef HAVE_SETRLIMIT
+#ifdef EVENT__HAVE_SETRLIMIT
rl.rlim_cur = rl.rlim_max = num_pipes * 2 + 50;
if (setrlimit(RLIMIT_NOFILE, &rl) == -1) {
perror("setrlimit");
--- test/bench_httpclient.c.orig 2017-01-25 23:37:15 UTC
+++ test/bench_httpclient.c
@@ -113,13 +113,13 @@ errorcb(struct bufferevent *b, short wha
static void
frob_socket(evutil_socket_t sock)
{
-#ifdef HAVE_SO_LINGER
+#ifdef EVENT__HAVE_STRUCT_LINGER
struct linger l;
#endif
int one = 1;
if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (void*)&one, sizeof(one))<0)
perror("setsockopt(SO_REUSEADDR)");
-#ifdef HAVE_SO_LINGER
+#ifdef EVENT__HAVE_STRUCT_LINGER
l.l_onoff = 1;
l.l_linger = 0;
if (setsockopt(sock, SOL_SOCKET, SO_LINGER, (void*)&l, sizeof(l))<0)