View | Details | Raw Unified | Return to bug 224200 | Differences between
and this patch

Collapse All | Expand All

(-)b/graphics/wayland/Makefile (-20 / +4 lines)
Lines 1-25 Link Here
1
# Created by: kwm@FreeBSD.org
1
# Created by: kwm@FreeBSD.org
2
# $FreeBSD$
2
# $FreeBSD$
3
3
4
# NOTE
5
# Changes made by kwm to use kevent instead of epoll
6
# are still in place. However, since libinput depends
7
# on libepoll-shim the simplest to do was to have Wayland
8
# also use it. Currently build will fail if epoll-shim
9
# is not available but can be built without epoll-shim
10
# if EPOLLSHIM_LIBS is cleared (configure.ac)
11
#
12
# TODO: Add condition for this in configure
13
#
14
# If we want to build Wayland with kwm's kevent patches
15
# and use epoll-shim for libinput we have to change it
16
# so that Wayland ignore epoll headers installed by
17
# epoll-shim.
18
# Maybe best is to use epoll-shim if it is good enough
19
# and keep diff with upstream minimal.
20
21
PORTNAME=	wayland
4
PORTNAME=	wayland
22
PORTVERSION=	1.13.0
5
PORTVERSION=	1.14.0
23
CATEGORIES=	graphics wayland
6
CATEGORIES=	graphics wayland
24
MASTER_SITES=	http://wayland.freedesktop.org/releases/
7
MASTER_SITES=	http://wayland.freedesktop.org/releases/
25
8
Lines 30-37 LICENSE= MIT Link Here
30
LICENSE_FILE=	${WRKSRC}/COPYING
13
LICENSE_FILE=	${WRKSRC}/COPYING
31
14
32
LIB_DEPENDS=	libexpat.so:textproc/expat2 \
15
LIB_DEPENDS=	libexpat.so:textproc/expat2 \
33
		libffi.so:devel/libffi \
16
	libffi.so:devel/libffi \
34
		libepoll-shim.so:devel/libepoll-shim
17
	libepoll-shim.so:devel/libepoll-shim
35
18
36
CFLAGS+=	"-I${LOCALBASE}/include/libepoll-shim"
19
CFLAGS+=	"-I${LOCALBASE}/include/libepoll-shim"
37
20
Lines 42-47 USE_GNOME= libxslt:build Link Here
42
USE_LDCONFIG=	yes
25
USE_LDCONFIG=	yes
43
GNU_CONFIGURE=	yes
26
GNU_CONFIGURE=	yes
44
CONFIGURE_ARGS=	--disable-documentation
27
CONFIGURE_ARGS=	--disable-documentation
28
CONFIGURE_ENV=  ac_cv_func_posix_fallocate=no # EINVAL for many FS on 12.0
45
INSTALL_TARGET=	install-strip
29
INSTALL_TARGET=	install-strip
46
30
47
.include <bsd.port.mk>
31
.include <bsd.port.mk>
(-)b/graphics/wayland/distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
TIMESTAMP = 1493984926
1
TIMESTAMP = 1507715269
2
SHA256 (wayland-1.13.0.tar.xz) = 69b052c031a61e89af7cc8780893d0da1e301492352aa449dee9345043e6fe51
2
SHA256 (wayland-1.14.0.tar.xz) = ed80cabc0961a759a42092e2c39aabfc1ec9a13c86c98bbe2b812f008da27ab8
3
SIZE (wayland-1.13.0.tar.xz) = 414508
3
SIZE (wayland-1.14.0.tar.xz) = 413960
(-)b/graphics/wayland/files/patch-Makefile.am (-1 / +1 lines)
Lines 1-4 Link Here
1
--- Makefile.am.orig	2017-05-05 11:54:01 UTC
1
--- Makefile.am.orig	2017-12-09 20:53:25 UTC
2
+++ Makefile.am
2
+++ Makefile.am
3
@@ -73,7 +73,7 @@ nodist_include_HEADERS =			\
3
@@ -73,7 +73,7 @@ nodist_include_HEADERS =			\
4
 	protocol/wayland-client-protocol.h
4
 	protocol/wayland-client-protocol.h
(-)b/graphics/wayland/files/patch-configure.ac (-12 / +8 lines)
Lines 1-16 Link Here
1
--- configure.ac.orig	2016-06-01 00:11:10 UTC
1
--- configure.ac.orig	2017-08-08 18:20:52 UTC
2
+++ configure.ac
2
+++ configure.ac
3
@@ -63,6 +63,28 @@ AC_SUBST(GCC_CFLAGS)
3
@@ -63,6 +63,25 @@ AC_SUBST(GCC_CFLAGS)
4
 
4
 
5
 AC_CHECK_FUNCS([accept4 mkostemp posix_fallocate])
5
 AC_CHECK_FUNCS([accept4 mkostemp posix_fallocate])
6
 
6
 
7
+AC_CHECK_HEADERS([sys/signalfd.h sys/timerfd.h])
7
+AC_CHECK_HEADERS([sys/signalfd.h sys/timerfd.h])
8
+
8
+
9
+# Use epoll on Linux or kqueue on BSD
9
+# Use epoll on Linux and epoll-shim (kqueue) on BSD
10
+AC_CHECK_HEADERS([sys/epoll.h sys/event.h])
10
+AC_CHECK_HEADERS([sys/epoll.h])
11
+if test "x$ac_cv_header_sys_epoll_h" != "xyes" && test "x$ac_cv_header_sys_event_h" != "xyes"; then
12
+       AC_MSG_ERROR([Can't find sys/epoll.h or sys/event.h. Please ensure either epoll or kqueue is available.])
13
+fi
14
+
11
+
15
+# Credential support on FreeBSD
12
+# Credential support on FreeBSD
16
+AC_CHECK_HEADERS([sys/ucred.h])
13
+AC_CHECK_HEADERS([sys/ucred.h])
Lines 29-35 Link Here
29
 AC_ARG_ENABLE([libraries],
26
 AC_ARG_ENABLE([libraries],
30
 	      [AC_HELP_STRING([--disable-libraries],
27
 	      [AC_HELP_STRING([--disable-libraries],
31
 			      [Disable compilation of wayland libraries])],
28
 			      [Disable compilation of wayland libraries])],
32
@@ -98,11 +120,12 @@ AC_SUBST([ICONDIR])
29
@@ -98,17 +117,21 @@ AC_SUBST([ICONDIR])
33
 
30
 
34
 if test "x$enable_libraries" = "xyes"; then
31
 if test "x$enable_libraries" = "xyes"; then
35
 	PKG_CHECK_MODULES(FFI, [libffi])
32
 	PKG_CHECK_MODULES(FFI, [libffi])
Lines 44-56 Link Here
44
 		      [[#include <sys/timerfd.h>]])
41
 		      [[#include <sys/timerfd.h>]])
45
 	AC_CHECK_DECL(CLOCK_MONOTONIC,[],
42
 	AC_CHECK_DECL(CLOCK_MONOTONIC,[],
46
 		      [AC_MSG_ERROR("CLOCK_MONOTONIC is needed to compile wayland libraries")],
43
 		      [AC_MSG_ERROR("CLOCK_MONOTONIC is needed to compile wayland libraries")],
47
@@ -110,6 +133,9 @@ if test "x$enable_libraries" = "xyes"; t
44
 		      [[#include <time.h>]])
48
 	AC_CHECK_HEADERS([execinfo.h])
45
 	AC_CHECK_HEADERS([execinfo.h])
49
 fi
46
 fi
50
 
47
+
51
+EPOLLSHIM_LIBS="-lepoll-shim"
48
+EPOLLSHIM_LIBS="-lepoll-shim"
52
+AC_SUBST(EPOLLSHIM_LIBS)
49
+AC_SUBST(EPOLLSHIM_LIBS)
53
+
50
 
54
 PKG_CHECK_MODULES(EXPAT, [expat], [],
51
 PKG_CHECK_MODULES(EXPAT, [expat], [],
55
 	[AC_CHECK_HEADERS(expat.h, [],
52
 	[AC_CHECK_HEADERS(expat.h, [],
56
 		[AC_MSG_ERROR([Can't find expat.h. Please install expat.])])
(-)b/graphics/wayland/files/patch-src_wayland-os.c (-23 / +6 lines)
Lines 1-6 Link Here
1
--- src/wayland-os.c.orig	2015-07-06 19:38:51 UTC
1
--- src/wayland-os.c.orig	2017-08-08 18:20:52 UTC
2
+++ src/wayland-os.c
2
+++ src/wayland-os.c
3
@@ -25,14 +25,20 @@
3
@@ -25,6 +25,8 @@
4
 
4
 
5
 #define _GNU_SOURCE
5
 #define _GNU_SOURCE
6
 
6
 
Lines 9-28 Link Here
9
 #include <sys/types.h>
9
 #include <sys/types.h>
10
 #include <sys/socket.h>
10
 #include <sys/socket.h>
11
 #include <unistd.h>
11
 #include <unistd.h>
12
 #include <fcntl.h>
12
@@ -32,7 +34,6 @@
13
 #include <errno.h>
13
 #include <errno.h>
14
+#ifdef HAVE_SYS_EPOLL_H
15
 #include <sys/epoll.h>
14
 #include <sys/epoll.h>
16
+#endif
17
+#ifdef HAVE_SYS_EVENT_H
18
+#include <sys/event.h>
19
+#endif
20
 
15
 
21
-#include "../config.h"
16
-#include "../config.h"
22
 #include "wayland-os.h"
17
 #include "wayland-os.h"
23
 
18
 
24
 static int
19
 static int
25
@@ -62,26 +68,50 @@ wl_os_socket_cloexec(int domain, int typ
20
@@ -62,26 +63,50 @@ wl_os_socket_cloexec(int domain, int type, int protoco
26
 {
21
 {
27
 	int fd;
22
 	int fd;
28
 
23
 
Lines 73-79 Link Here
73
 
68
 
74
 	newfd = fcntl(fd, F_DUPFD, minfd);
69
 	newfd = fcntl(fd, F_DUPFD, minfd);
75
 	return set_cloexec_or_close(newfd);
70
 	return set_cloexec_or_close(newfd);
76
@@ -123,15 +153,18 @@ wl_os_recvmsg_cloexec(int sockfd, struct
71
@@ -123,15 +148,18 @@ wl_os_recvmsg_cloexec(int sockfd, struct msghdr *msg, 
77
 {
72
 {
78
 	ssize_t len;
73
 	ssize_t len;
79
 
74
 
Lines 92-113 Link Here
92
 int
87
 int
93
 wl_os_epoll_create_cloexec(void)
88
 wl_os_epoll_create_cloexec(void)
94
 {
89
 {
95
@@ -148,6 +181,19 @@ wl_os_epoll_create_cloexec(void)
90
@@ -148,6 +176,7 @@ wl_os_epoll_create_cloexec(void)
96
 	fd = epoll_create(1);
91
 	fd = epoll_create(1);
97
 	return set_cloexec_or_close(fd);
92
 	return set_cloexec_or_close(fd);
98
 }
93
 }
99
+#endif
100
+
101
+#ifdef HAVE_SYS_EVENT_H
102
+int
103
+wl_os_kqueue_create_cloexec(void)
104
+{
105
+	int fd;
106
+
107
+	fd = kqueue();
108
+
109
+	return set_cloexec_or_close(fd);
110
+}
111
+#endif
94
+#endif
112
 
95
 
113
 int
96
 int
(-)b/graphics/wayland/files/patch-src_wayland-os.h (-18 / +2 lines)
Lines 1-6 Link Here
1
--- src/wayland-os.h.orig	2015-07-06 19:38:51 UTC
1
--- src/wayland-os.h.orig	2017-08-08 18:20:52 UTC
2
+++ src/wayland-os.h
2
+++ src/wayland-os.h
3
@@ -30,13 +30,25 @@ int
3
@@ -30,6 +30,9 @@ int
4
 wl_os_socket_cloexec(int domain, int type, int protocol);
4
 wl_os_socket_cloexec(int domain, int type, int protocol);
5
 
5
 
6
 int
6
 int
Lines 10-28 Link Here
10
 wl_os_dupfd_cloexec(int fd, long minfd);
10
 wl_os_dupfd_cloexec(int fd, long minfd);
11
 
11
 
12
 ssize_t
12
 ssize_t
13
 wl_os_recvmsg_cloexec(int sockfd, struct msghdr *msg, int flags);
14
 
15
+/* FIXME? not sure if this will work in this header like this ...
16
+   though seems build only header perhaps? */
17
+#ifdef HAVE_SYS_EPOLL_H
18
 int
19
 wl_os_epoll_create_cloexec(void);
20
+#endif
21
+
22
+#ifdef HAVE_SYS_EVENT_H
23
+int
24
+wl_os_kqueue_create_cloexec(void);
25
+#endif
26
 
27
 int
28
 wl_os_accept_cloexec(int sockfd, struct sockaddr *addr, socklen_t *addrlen);
(-)b/graphics/wayland/files/patch-src_wayland-server.c (-6 / +6 lines)
Lines 1-4 Link Here
1
--- src/wayland-server.c.orig	2017-02-07 22:59:06 UTC
1
--- src/wayland-server.c.orig	2017-08-08 18:20:52 UTC
2
+++ src/wayland-server.c
2
+++ src/wayland-server.c
3
@@ -25,6 +25,8 @@
3
@@ -25,6 +25,8 @@
4
 
4
 
Lines 21-27 Link Here
21
 #include "wayland-util.h"
21
 #include "wayland-util.h"
22
 #include "wayland-private.h"
22
 #include "wayland-private.h"
23
 #include "wayland-server.h"
23
 #include "wayland-server.h"
24
@@ -79,7 +86,13 @@ struct wl_client {
24
@@ -77,7 +84,13 @@ struct wl_client {
25
 	struct wl_list link;
25
 	struct wl_list link;
26
 	struct wl_map objects;
26
 	struct wl_map objects;
27
 	struct wl_priv_signal destroy_signal;
27
 	struct wl_priv_signal destroy_signal;
Lines 35-41 Link Here
35
 	int error;
35
 	int error;
36
 	struct wl_priv_signal resource_created_signal;
36
 	struct wl_priv_signal resource_created_signal;
37
 };
37
 };
38
@@ -503,10 +516,20 @@ wl_client_create(struct wl_display *disp
38
@@ -501,10 +514,20 @@ wl_client_create(struct wl_display *display, int fd)
39
 	if (!client->source)
39
 	if (!client->source)
40
 		goto err_client;
40
 		goto err_client;
41
 
41
 
Lines 56-68 Link Here
56
 
56
 
57
 	client->connection = wl_connection_create(fd);
57
 	client->connection = wl_connection_create(fd);
58
 	if (client->connection == NULL)
58
 	if (client->connection == NULL)
59
@@ -560,12 +583,23 @@ WL_EXPORT void
59
@@ -558,12 +581,23 @@ WL_EXPORT void
60
 wl_client_get_credentials(struct wl_client *client,
60
 wl_client_get_credentials(struct wl_client *client,
61
 			  pid_t *pid, uid_t *uid, gid_t *gid)
61
 			  pid_t *pid, uid_t *uid, gid_t *gid)
62
 {
62
 {
63
+#ifdef HAVE_SYS_UCRED_H
63
+#ifdef HAVE_SYS_UCRED_H
64
+	/* FreeBSD */
64
+	/* FreeBSD */
65
+	if (pid)
65
 	if (pid)
66
+		*pid = 0; /* FIXME: not defined on FreeBSD */
66
+		*pid = 0; /* FIXME: not defined on FreeBSD */
67
+	if (uid)
67
+	if (uid)
68
+		*uid = client->xucred.cr_uid;
68
+		*uid = client->xucred.cr_uid;
Lines 70-76 Link Here
70
+		*gid = client->xucred.cr_gid;
70
+		*gid = client->xucred.cr_gid;
71
+#else
71
+#else
72
+	/* Linux */
72
+	/* Linux */
73
 	if (pid)
73
+	if (pid)
74
 		*pid = client->ucred.pid;
74
 		*pid = client->ucred.pid;
75
 	if (uid)
75
 	if (uid)
76
 		*uid = client->ucred.uid;
76
 		*uid = client->ucred.uid;
(-)b/graphics/wayland/files/patch-src_wayland-shm.c (-4 / +4 lines)
Lines 1-4 Link Here
1
--- src/wayland-shm.c.orig	2016-11-18 00:32:40 UTC
1
--- src/wayland-shm.c.orig	2017-08-08 18:20:52 UTC
2
+++ src/wayland-shm.c
2
+++ src/wayland-shm.c
3
@@ -30,6 +30,8 @@
3
@@ -30,6 +30,8 @@
4
 
4
 
Lines 45-51 Link Here
45
 	if (data == MAP_FAILED) {
45
 	if (data == MAP_FAILED) {
46
 		wl_resource_post_error(pool->resource,
46
 		wl_resource_post_error(pool->resource,
47
 				       WL_SHM_ERROR_INVALID_FD,
47
 				       WL_SHM_ERROR_INVALID_FD,
48
@@ -110,6 +124,10 @@ shm_pool_unref(struct wl_shm_pool *pool,
48
@@ -110,6 +124,10 @@ shm_pool_unref(struct wl_shm_pool *pool, bool external
49
 	if (pool->internal_refcount + pool->external_refcount)
49
 	if (pool->internal_refcount + pool->external_refcount)
50
 		return;
50
 		return;
51
 
51
 
Lines 56-62 Link Here
56
 	munmap(pool->data, pool->size);
56
 	munmap(pool->data, pool->size);
57
 	free(pool);
57
 	free(pool);
58
 }
58
 }
59
@@ -223,6 +241,73 @@ shm_pool_destroy(struct wl_client *clien
59
@@ -223,6 +241,73 @@ shm_pool_destroy(struct wl_client *client, struct wl_r
60
 	wl_resource_destroy(resource);
60
 	wl_resource_destroy(resource);
61
 }
61
 }
62
 
62
 
Lines 130-136 Link Here
130
 static void
130
 static void
131
 shm_pool_resize(struct wl_client *client, struct wl_resource *resource,
131
 shm_pool_resize(struct wl_client *client, struct wl_resource *resource,
132
 		int32_t size)
132
 		int32_t size)
133
@@ -284,7 +369,14 @@ shm_create_pool(struct wl_client *client
133
@@ -284,7 +369,14 @@ shm_create_pool(struct wl_client *client, struct wl_re
134
 				       "failed mmap fd %d", fd);
134
 				       "failed mmap fd %d", fd);
135
 		goto err_free;
135
 		goto err_free;
136
 	}
136
 	}
(-)b/graphics/wayland/files/patch-tests_client-test.c (-1 / +1 lines)
Lines 1-4 Link Here
1
--- tests/client-test.c.orig	2015-07-06 19:38:51 UTC
1
--- tests/client-test.c.orig	2017-08-08 18:20:52 UTC
2
+++ tests/client-test.c
2
+++ tests/client-test.c
3
@@ -34,6 +34,7 @@
3
@@ -34,6 +34,7 @@
4
 #include <sys/types.h>
4
 #include <sys/types.h>
(-)b/graphics/wayland/files/patch-tests_connection-test.c (-1 / +1 lines)
Lines 1-4 Link Here
1
--- tests/connection-test.c.orig	2017-02-07 22:59:06 UTC
1
--- tests/connection-test.c.orig	2017-08-08 18:20:52 UTC
2
+++ tests/connection-test.c
2
+++ tests/connection-test.c
3
@@ -37,6 +37,7 @@
3
@@ -37,6 +37,7 @@
4
 #include <sys/stat.h>
4
 #include <sys/stat.h>
(-)b/graphics/wayland/files/patch-tests_event-loop-test.c (-5 / +4 lines)
Lines 1-4 Link Here
1
--- tests/event-loop-test.c.orig	2016-10-22 16:23:10 UTC
1
--- tests/event-loop-test.c.orig	2017-08-08 18:20:52 UTC
2
+++ tests/event-loop-test.c
2
+++ tests/event-loop-test.c
3
@@ -167,10 +167,10 @@ TEST(event_loop_signal)
3
@@ -167,10 +167,10 @@ TEST(event_loop_signal)
4
 					  signal_callback, &got_it);
4
 					  signal_callback, &got_it);
Lines 14-20 Link Here
14
 	assert(got_it == 1);
14
 	assert(got_it == 1);
15
 
15
 
16
 	wl_event_source_remove(source);
16
 	wl_event_source_remove(source);
17
@@ -234,12 +234,20 @@ TEST(event_loop_timer)
17
@@ -234,11 +234,19 @@ TEST(event_loop_timer)
18
 
18
 
19
 	source = wl_event_loop_add_timer(loop, timer_callback, &got_it);
19
 	source = wl_event_loop_add_timer(loop, timer_callback, &got_it);
20
 	assert(source);
20
 	assert(source);
Lines 29-40 Link Here
29
+	* See: http://unix.derkeiler.com/Mailing-Lists/FreeBSD/hackers/2012-07/msg00319.html */
29
+	* See: http://unix.derkeiler.com/Mailing-Lists/FreeBSD/hackers/2012-07/msg00319.html */
30
+	assert(wl_event_loop_dispatch(loop, 50) == 0);
30
+	assert(wl_event_loop_dispatch(loop, 50) == 0);
31
 	assert(got_it == 1);
31
 	assert(got_it == 1);
32
 
32
+
33
+	/* Check it doesn't fire again. */
33
+	/* Check it doesn't fire again. */
34
+	got_it = 0;
34
+	got_it = 0;
35
+	assert(wl_event_loop_dispatch(loop, 20) == 0);
35
+	assert(wl_event_loop_dispatch(loop, 20) == 0);
36
+	assert(!got_it);
36
+	assert(!got_it);
37
+
37
 
38
 	wl_event_source_remove(source);
38
 	wl_event_source_remove(source);
39
 	wl_event_loop_destroy(loop);
39
 	wl_event_loop_destroy(loop);
40
 }
(-)b/graphics/wayland/files/patch-tests_os-wrappers-test.c (-90 / +8 lines)
Lines 1-4 Link Here
1
--- tests/os-wrappers-test.c.orig	2016-10-22 16:23:10 UTC
1
--- tests/os-wrappers-test.c.orig	2017-08-08 18:20:52 UTC
2
+++ tests/os-wrappers-test.c
2
+++ tests/os-wrappers-test.c
3
@@ -26,6 +26,8 @@
3
@@ -26,6 +26,8 @@
4
 
4
 
Lines 9-55 Link Here
9
 #include <stdlib.h>
9
 #include <stdlib.h>
10
 #include <stdint.h>
10
 #include <stdint.h>
11
 #include <assert.h>
11
 #include <assert.h>
12
@@ -38,7 +40,13 @@
12
@@ -73,10 +75,12 @@ socket(int domain, int type, int protocol)
13
 #include <stdarg.h>
14
 #include <fcntl.h>
15
 #include <stdio.h>
16
+
17
+#ifdef HAVE_SYS_EPOLL_H
18
 #include <sys/epoll.h>
19
+#elif HAVE_SYS_EVENT_H
20
+#include <sys/event.h>
21
+#include <sys/types.h>
22
+#endif
23
 
24
 #include "wayland-private.h"
25
 #include "test-runner.h"
26
@@ -55,8 +63,13 @@ static int wrapped_calls_fcntl;
27
 static ssize_t (*real_recvmsg)(int, struct msghdr *, int);
28
 static int wrapped_calls_recvmsg;
29
 
30
+#ifdef HAVE_SYS_EPOLL_H
31
 static int (*real_epoll_create1)(int);
32
 static int wrapped_calls_epoll_create1;
33
+#elif HAVE_SYS_EVENT_H
34
+static int (*real_kqueue)(void);
35
+static int wrapped_calls_kqueue;
36
+#endif
37
 
38
 static void
39
 init_fallbacks(int do_fallbacks)
40
@@ -65,7 +78,11 @@ init_fallbacks(int do_fallbacks)
41
 	real_socket = dlsym(RTLD_NEXT, "socket");
42
 	real_fcntl = dlsym(RTLD_NEXT, "fcntl");
43
 	real_recvmsg = dlsym(RTLD_NEXT, "recvmsg");
44
+#ifdef HAVE_SYS_EPOLL_H
45
 	real_epoll_create1 = dlsym(RTLD_NEXT, "epoll_create1");
46
+#elif HAVE_SYS_EVENT_H
47
+	real_kqueue = dlsym(RTLD_NEXT, "kqueue");
48
+#endif
49
 }
50
 
51
 __attribute__ ((visibility("default"))) int
52
@@ -73,10 +90,12 @@ socket(int domain, int type, int protoco
53
 {
13
 {
54
 	wrapped_calls_socket++;
14
 	wrapped_calls_socket++;
55
 
15
 
Lines 62-68 Link Here
62
 
22
 
63
 	return real_socket(domain, type, protocol);
23
 	return real_socket(domain, type, protocol);
64
 }
24
 }
65
@@ -89,10 +108,12 @@ fcntl(int fd, int cmd, ...)
25
@@ -89,10 +93,12 @@ fcntl(int fd, int cmd, ...)
66
 
26
 
67
 	wrapped_calls_fcntl++;
27
 	wrapped_calls_fcntl++;
68
 
28
 
Lines 75-81 Link Here
75
 
35
 
76
 	va_start(ap, cmd);
36
 	va_start(ap, cmd);
77
 	arg = va_arg(ap, void*);
37
 	arg = va_arg(ap, void*);
78
@@ -106,14 +127,17 @@ recvmsg(int sockfd, struct msghdr *msg, 
38
@@ -106,10 +112,12 @@ recvmsg(int sockfd, struct msghdr *msg, int flags)
79
 {
39
 {
80
 	wrapped_calls_recvmsg++;
40
 	wrapped_calls_recvmsg++;
81
 
41
 
Lines 88-115 Link Here
88
 
48
 
89
 	return real_recvmsg(sockfd, msg, flags);
49
 	return real_recvmsg(sockfd, msg, flags);
90
 }
50
 }
91
 
51
@@ -156,12 +164,14 @@ TEST(os_wrappers_socket_cloexec)
92
+#ifdef HAVE_SYS_EPOLL_H
93
 __attribute__ ((visibility("default"))) int
94
 epoll_create1(int flags)
95
 {
96
@@ -127,6 +151,15 @@ epoll_create1(int flags)
97
 
98
 	return real_epoll_create1(flags);
99
 }
100
+#elif HAVE_SYS_EVENT_H
101
+__attribute__ ((visibility("default"))) int
102
+kqueue(void)
103
+{
104
+       wrapped_calls_kqueue++;
105
+
106
+       return real_kqueue();
107
+}
108
+#endif
109
 
110
 static void
111
 do_os_wrappers_socket_cloexec(int n)
112
@@ -156,12 +189,14 @@ TEST(os_wrappers_socket_cloexec)
113
 	do_os_wrappers_socket_cloexec(0);
52
 	do_os_wrappers_socket_cloexec(0);
114
 }
53
 }
115
 
54
 
Lines 124-130 Link Here
124
 
63
 
125
 static void
64
 static void
126
 do_os_wrappers_dupfd_cloexec(int n)
65
 do_os_wrappers_dupfd_cloexec(int n)
127
@@ -195,11 +230,13 @@ TEST(os_wrappers_dupfd_cloexec)
66
@@ -195,11 +205,13 @@ TEST(os_wrappers_dupfd_cloexec)
128
 	do_os_wrappers_dupfd_cloexec(0);
67
 	do_os_wrappers_dupfd_cloexec(0);
129
 }
68
 }
130
 
69
 
Lines 138-144 Link Here
138
 
77
 
139
 struct marshal_data {
78
 struct marshal_data {
140
 	struct wl_connection *read_connection;
79
 	struct wl_connection *read_connection;
141
@@ -218,8 +255,7 @@ struct marshal_data {
80
@@ -218,8 +230,7 @@ struct marshal_data {
142
 static void
81
 static void
143
 setup_marshal_data(struct marshal_data *data)
82
 setup_marshal_data(struct marshal_data *data)
144
 {
83
 {
Lines 148-154 Link Here
148
 
87
 
149
 	data->read_connection = wl_connection_create(data->s[0]);
88
 	data->read_connection = wl_connection_create(data->s[0]);
150
 	assert(data->read_connection);
89
 	assert(data->read_connection);
151
@@ -328,11 +364,13 @@ TEST(os_wrappers_recvmsg_cloexec)
90
@@ -328,11 +339,13 @@ TEST(os_wrappers_recvmsg_cloexec)
152
 	do_os_wrappers_recvmsg_cloexec(0);
91
 	do_os_wrappers_recvmsg_cloexec(0);
153
 }
92
 }
154
 
93
 
Lines 162-185 Link Here
162
 
101
 
163
 static void
102
 static void
164
 do_os_wrappers_epoll_create_cloexec(int n)
103
 do_os_wrappers_epoll_create_cloexec(int n)
165
@@ -342,12 +380,20 @@ do_os_wrappers_epoll_create_cloexec(int 
166
 
167
 	nr_fds = count_open_fds();
168
 
169
+#ifdef HAVE_SYS_EPOLL_H
170
 	fd = wl_os_epoll_create_cloexec();
171
+#elif HAVE_SYS_EVENT_H
172
+	fd = wl_os_kqueue_create_cloexec();
173
+#endif
174
 	assert(fd >= 0);
175
 
176
 #ifdef EPOLL_CLOEXEC
177
+#ifdef HAVE_SYS_EPOLL_H
178
 	assert(wrapped_calls_epoll_create1 == n);
179
 #else
180
+	assert(wrapped_calls_kqueue == n);
181
+#endif
182
+#else
183
 	printf("No epoll_create1.\n");
184
 #endif
185
 
(-)b/graphics/wayland/files/patch-tests_queue-test.c (-1 / +1 lines)
Lines 1-4 Link Here
1
--- tests/queue-test.c.orig	2016-10-22 16:23:10 UTC
1
--- tests/queue-test.c.orig	2017-08-08 18:20:52 UTC
2
+++ tests/queue-test.c
2
+++ tests/queue-test.c
3
@@ -23,6 +23,8 @@
3
@@ -23,6 +23,8 @@
4
  * SOFTWARE.
4
  * SOFTWARE.
(-)b/graphics/wayland/files/patch-tests_sanity-test.c (-1 / +1 lines)
Lines 1-4 Link Here
1
--- tests/sanity-test.c.orig	2016-02-17 01:13:16 UTC
1
--- tests/sanity-test.c.orig	2017-08-08 18:20:52 UTC
2
+++ tests/sanity-test.c
2
+++ tests/sanity-test.c
3
@@ -92,7 +92,8 @@ FAIL_TEST(sanity_malloc_direct)
3
@@ -92,7 +92,8 @@ FAIL_TEST(sanity_malloc_direct)
4
 TEST(disable_leak_checks)
4
 TEST(disable_leak_checks)
(-)b/graphics/wayland/files/patch-tests_test-helpers.c (-1 / +1 lines)
Lines 1-4 Link Here
1
--- tests/test-helpers.c.orig	2015-07-06 19:38:51 UTC
1
--- tests/test-helpers.c.orig	2017-08-08 18:20:52 UTC
2
+++ tests/test-helpers.c
2
+++ tests/test-helpers.c
3
@@ -23,6 +23,12 @@
3
@@ -23,6 +23,12 @@
4
  * SOFTWARE.
4
  * SOFTWARE.
(-)b/graphics/wayland/files/patch-tests_test-runner.c (-7 / +9 lines)
Lines 1-4 Link Here
1
--- tests/test-runner.c.orig	2016-11-18 00:32:40 UTC
1
--- tests/test-runner.c.orig	2017-08-08 18:20:52 UTC
2
+++ tests/test-runner.c
2
+++ tests/test-runner.c
3
@@ -25,6 +25,12 @@
3
@@ -25,6 +25,12 @@
4
 
4
 
Lines 13-19 Link Here
13
 #include <unistd.h>
13
 #include <unistd.h>
14
 #include <stdio.h>
14
 #include <stdio.h>
15
 #include <stdlib.h>
15
 #include <stdlib.h>
16
@@ -37,18 +43,35 @@
16
@@ -37,19 +43,36 @@
17
 #include <errno.h>
17
 #include <errno.h>
18
 #include <limits.h>
18
 #include <limits.h>
19
 #include <sys/ptrace.h>
19
 #include <sys/ptrace.h>
Lines 39-54 Link Here
39
 static void* (*sys_realloc)(void*, size_t);
39
 static void* (*sys_realloc)(void*, size_t);
40
 static void* (*sys_calloc)(size_t, size_t);
40
 static void* (*sys_calloc)(size_t, size_t);
41
+#endif
41
+#endif
42
+
42
 
43
+#ifdef __FreeBSD__
43
+#ifdef __FreeBSD__
44
+/* XXX review ptrace() usage */
44
+/* XXX review ptrace() usage */
45
+#define PTRACE_ATTACH PT_ATTACH
45
+#define PTRACE_ATTACH PT_ATTACH
46
+#define PTRACE_CONT PT_CONTINUE
46
+#define PTRACE_CONT PT_CONTINUE
47
+#define PTRACE_DETACH PT_DETACH
47
+#define PTRACE_DETACH PT_DETACH
48
+#endif
48
+#endif
49
 
49
+
50
 /* when set to 1, check if tests are not leaking memory and opened files.
50
 /* when set to 1, check if tests are not leaking memory and opened files.
51
  * It is turned on by default. It can be turned off by
51
  * It is turned on by default. It can be turned off by
52
  * WAYLAND_TEST_NO_LEAK_CHECK environment variable. */
52
@@ -57,7 +80,7 @@ int leak_check_enabled;
53
@@ -57,7 +80,7 @@ int leak_check_enabled;
53
 
54
 
54
 /* when this var is set to 0, every call to test_set_timeout() is
55
 /* when this var is set to 0, every call to test_set_timeout() is
Lines 115-121 Link Here
115
 	if (is_debugger_attached()) {
116
 	if (is_debugger_attached()) {
116
 		leak_check_enabled = 0;
117
 		leak_check_enabled = 0;
117
 		timeouts_enabled = 0;
118
 		timeouts_enabled = 0;
118
@@ -364,6 +393,16 @@ int main(int argc, char *argv[])
119
@@ -364,7 +393,17 @@ int main(int argc, char *argv[])
119
 		leak_check_enabled = !getenv("WAYLAND_TEST_NO_LEAK_CHECK");
120
 		leak_check_enabled = !getenv("WAYLAND_TEST_NO_LEAK_CHECK");
120
 		timeouts_enabled = !getenv("WAYLAND_TEST_NO_TIMEOUTS");
121
 		timeouts_enabled = !getenv("WAYLAND_TEST_NO_TIMEOUTS");
121
 	}
122
 	}
Lines 125-137 Link Here
125
+	/* XXX review later */
126
+	/* XXX review later */
126
+	timeouts_enabled = 0;
127
+	timeouts_enabled = 0;
127
+#endif
128
+#endif
128
+
129
 
129
+	if (isatty(fileno(stderr)))
130
+	if (isatty(fileno(stderr)))
130
+		is_atty = 1;
131
+		is_atty = 1;
131
+
132
+
132
 
133
+
133
 	if (argc == 2 && strcmp(argv[1], "--help") == 0)
134
 	if (argc == 2 && strcmp(argv[1], "--help") == 0)
134
 		usage(argv[0], EXIT_SUCCESS);
135
 		usage(argv[0], EXIT_SUCCESS);
136
 
135
@@ -395,7 +434,8 @@ int main(int argc, char *argv[])
137
@@ -395,7 +434,8 @@ int main(int argc, char *argv[])
136
 		if (pid == 0)
138
 		if (pid == 0)
137
 			run_test(t); /* never returns */
139
 			run_test(t); /* never returns */

Return to bug 224200