pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

wayland: update to 1.17



Module Name:	pkgsrc-wip
Committed By:	coypu <coypu%sdf.org@localhost>
Pushed By:	coypu
Date:		Sat Apr 27 00:22:42 2019 +0300
Changeset:	c2d8ac3201398447dfcf3a90c76db0d03bbf2b63

Modified Files:
	wayland/Makefile
	wayland/PLIST
	wayland/distinfo
	wayland/patches/patch-Makefile.am
	wayland/patches/patch-configure.ac
	wayland/patches/patch-src_wayland-server.c
	wayland/patches/patch-src_wayland-shm.c
	wayland/patches/patch-tests_event-loop-test.c
	wayland/patches/patch-tests_sanity-test.c
	wayland/patches/patch-tests_test-helpers.c
	wayland/patches/patch-tests_test-runner.c

Log Message:
wayland: update to 1.17

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=c2d8ac3201398447dfcf3a90c76db0d03bbf2b63

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 wayland/Makefile                              |   2 +-
 wayland/PLIST                                 |   4 +
 wayland/distinfo                              |  24 +++---
 wayland/patches/patch-Makefile.am             |  32 ++------
 wayland/patches/patch-configure.ac            |  24 +++---
 wayland/patches/patch-src_wayland-server.c    |  16 +++-
 wayland/patches/patch-src_wayland-shm.c       |  16 ++--
 wayland/patches/patch-tests_event-loop-test.c |   9 +-
 wayland/patches/patch-tests_sanity-test.c     |  31 ++++---
 wayland/patches/patch-tests_test-helpers.c    |  20 ++---
 wayland/patches/patch-tests_test-runner.c     | 113 +++++++++-----------------
 11 files changed, 120 insertions(+), 171 deletions(-)

diffs:
diff --git a/wayland/Makefile b/wayland/Makefile
index f5afbe9b72..5700ff95bb 100644
--- a/wayland/Makefile
+++ b/wayland/Makefile
@@ -1,7 +1,7 @@
 # $NetBSD$
 #
 
-DISTNAME=	wayland-1.14.0
+DISTNAME=	wayland-1.17.0
 CATEGORIES=	graphics
 MASTER_SITES=	http://wayland.freedesktop.org/releases/
 EXTRACT_SUFX=	.tar.xz
diff --git a/wayland/PLIST b/wayland/PLIST
index f1f8bd1842..d5a78e2e23 100644
--- a/wayland/PLIST
+++ b/wayland/PLIST
@@ -4,6 +4,7 @@ include/wayland-client-core.h
 include/wayland-client-protocol.h
 include/wayland-client.h
 include/wayland-cursor.h
+include/wayland-egl-backend.h
 include/wayland-egl-core.h
 include/wayland-egl.h
 include/wayland-server-core.h
@@ -13,9 +14,12 @@ include/wayland-util.h
 include/wayland-version.h
 lib/libwayland-client.la
 lib/libwayland-cursor.la
+lib/libwayland-egl.la
 lib/libwayland-server.la
 lib/pkgconfig/wayland-client.pc
 lib/pkgconfig/wayland-cursor.pc
+lib/pkgconfig/wayland-egl-backend.pc
+lib/pkgconfig/wayland-egl.pc
 lib/pkgconfig/wayland-scanner.pc
 lib/pkgconfig/wayland-server.pc
 share/aclocal/wayland-scanner.m4
diff --git a/wayland/distinfo b/wayland/distinfo
index 0dddb9d1da..f903e41abe 100644
--- a/wayland/distinfo
+++ b/wayland/distinfo
@@ -1,21 +1,21 @@
 $NetBSD$
 
-SHA1 (wayland-1.14.0.tar.xz) = 53a443be3bafe73209bbc49ef2cb134ed16e0141
-RMD160 (wayland-1.14.0.tar.xz) = b6e3f0bccde63eef905700d98c364b433e859762
-SHA512 (wayland-1.14.0.tar.xz) = bd38b2b8963d4d98d42c270e5d7dbff6323789a173b19b67a18258424fd8adee5021b282c9d7f6dad0bd25aa0160e76aecd8ed803d4eb25d911ef0a81cd713a5
-Size (wayland-1.14.0.tar.xz) = 413960 bytes
-SHA1 (patch-Makefile.am) = 086e3ab80dbaae733ea7c4084aae210026585c99
-SHA1 (patch-configure.ac) = e14c4ee81c2589a2b2ddd2f95aa7ae5bcf5d055e
+SHA1 (wayland-1.17.0.tar.xz) = 4d9e08a7a4a07fa37a25d7aa3ef83f08edec0600
+RMD160 (wayland-1.17.0.tar.xz) = 635494fb0f5d9eb1e782f98e08c3e0e26ff44268
+SHA512 (wayland-1.17.0.tar.xz) = c5051aab5ff078b368c196ecfedb33ccd961265bb914845d7ed81de361bb86ae18299575baa6c4eceb0d82cf8b495e8293f31b51d1cbc05d84af0a199ab3f946
+Size (wayland-1.17.0.tar.xz) = 437680 bytes
+SHA1 (patch-Makefile.am) = f48d5acd6d1dd4f17a22ebe951ec621790efcff1
+SHA1 (patch-configure.ac) = 0d1b289b9b4ecfecf8c3aa1314b2fbd66b86d38a
 SHA1 (patch-src_event-loop.c) = 99bd6717302044430732cff21ede40e0849f026e
 SHA1 (patch-src_wayland-os.c) = 8d88cc2712b9ce8a4df8b05b6a2182d964c77ef1
 SHA1 (patch-src_wayland-os.h) = 0a8d2c7c4cbc68bedf78a924b9919158de540721
-SHA1 (patch-src_wayland-server.c) = 00c35945e8b3609f7e4e1fefd376d5d5546b8d5b
-SHA1 (patch-src_wayland-shm.c) = 6a6f49d531dcb8c9b4c7abdc139536e934c54fcb
+SHA1 (patch-src_wayland-server.c) = 335de8f5390eb337dfbde26f523162bd44c06baf
+SHA1 (patch-src_wayland-shm.c) = 1eb094125b13f4c5fcaaa058d86d246d867dcdba
 SHA1 (patch-tests_client-test.c) = 6ffe18dfd64176a92f6f795eb757c54a3cf0ad10
 SHA1 (patch-tests_connection-test.c) = af53116c99cbb8d6570bcec66bfd895c1ae01700
-SHA1 (patch-tests_event-loop-test.c) = 066be5163808b0a2727de514d3a7eb4493238dc5
+SHA1 (patch-tests_event-loop-test.c) = 79909fdce7b73a7b19c58d3711329f6288fe7204
 SHA1 (patch-tests_os-wrappers-test.c) = df3605d6dfd2f8da3b62ea73b0255f6ce6b4a66a
 SHA1 (patch-tests_queue-test.c) = 3ee8433faa50b033ab880d3c5b6a9846063d6bd6
-SHA1 (patch-tests_sanity-test.c) = 0457b89e90b31955b9c9c9f3f848c53d5c4e1f9f
-SHA1 (patch-tests_test-helpers.c) = e16e9aeac44a80e27dffd223e6c15c376d917a68
-SHA1 (patch-tests_test-runner.c) = a15a71fa10b8e8e55fbc307854e36842fab5e28b
+SHA1 (patch-tests_sanity-test.c) = c06e78ec19326a14386972a4dc56584f712c836e
+SHA1 (patch-tests_test-helpers.c) = d0e80087f03897761bb000a4a83a7f5979518a24
+SHA1 (patch-tests_test-runner.c) = 5e2c993a07403ebd46a27c5939ae5cc141b4027c
diff --git a/wayland/patches/patch-Makefile.am b/wayland/patches/patch-Makefile.am
index 60ef6596f3..d592256bd6 100644
--- a/wayland/patches/patch-Makefile.am
+++ b/wayland/patches/patch-Makefile.am
@@ -1,10 +1,8 @@
 $NetBSD$
 
-BSD support from FreeBSD
-
---- Makefile.am.orig	2017-05-05 11:54:01 UTC
+--- Makefile.am.orig	2019-03-21 00:55:25.000000000 +0000
 +++ Makefile.am
-@@ -73,7 +73,7 @@ nodist_include_HEADERS =			\
+@@ -71,7 +71,7 @@ nodist_include_HEADERS =			\
  	protocol/wayland-client-protocol.h
  
  libwayland_server_la_CFLAGS = $(FFI_CFLAGS) $(AM_CFLAGS) -pthread
@@ -13,7 +11,7 @@ BSD support from FreeBSD
  libwayland_server_la_LDFLAGS = -version-info 1:0:1
  libwayland_server_la_SOURCES =			\
  	src/wayland-server.c			\
-@@ -85,7 +85,7 @@ nodist_libwayland_server_la_SOURCES =		\
+@@ -83,7 +83,7 @@ nodist_libwayland_server_la_SOURCES =		\
  	protocol/wayland-protocol.c
  
  libwayland_client_la_CFLAGS = $(FFI_CFLAGS) $(AM_CFLAGS) -pthread
@@ -22,30 +20,12 @@ BSD support from FreeBSD
  libwayland_client_la_LDFLAGS = -version-info 3:0:3
  libwayland_client_la_SOURCES =			\
  	src/wayland-client.c
-@@ -180,12 +180,12 @@ AM_TESTS_ENVIRONMENT =							\
- TESTS = $(built_test_programs)			\
- 	tests/scanner-test.sh
- 
--noinst_PROGRAMS =				\
--	$(built_test_programs)			\
--	exec-fd-leak-checker			\
--	fixed-benchmark
-+#noinst_PROGRAMS =				\
-+#	$(built_test_programs)			\
-+#	exec-fd-leak-checker			\
-+#	fixed-benchmark
- 
--noinst_LTLIBRARIES += libtest-runner.la
-+#noinst_LTLIBRARIES += libtest-runner.la
- 
- libtest_runner_la_SOURCES =			\
- 	tests/test-runner.c			\
-@@ -198,7 +198,7 @@ libtest_runner_la_LIBADD =			\
- 	libwayland-util.la			\
+@@ -227,7 +227,7 @@ libtest_runner_la_LIBADD =			\
  	libwayland-client.la			\
  	libwayland-server.la			\
+ 	libtest-helpers.la			\
 -	-lrt -ldl $(FFI_LIBS)
 +	-lrt $(DL_LIBS) $(FFI_LIBS) $(EPOLLSHIM_LIBS)
  
- 
  array_test_SOURCES = tests/array-test.c
+ array_test_LDADD = libtest-runner.la
diff --git a/wayland/patches/patch-configure.ac b/wayland/patches/patch-configure.ac
index c90fcca273..b4357acd5d 100644
--- a/wayland/patches/patch-configure.ac
+++ b/wayland/patches/patch-configure.ac
@@ -1,12 +1,10 @@
-$NetBSD$
-
-BSD support from FreeBSD
-
---- configure.ac.orig	2017-08-08 18:20:52 UTC
+--- configure.ac.orig	2018-08-24 18:04:36 UTC
 +++ configure.ac
-@@ -63,6 +63,25 @@ AC_SUBST(GCC_CFLAGS)
- 
- AC_CHECK_FUNCS([accept4 mkostemp posix_fallocate])
+--- configure.ac.orig	2019-03-21 00:55:25.000000000 +0000
++++ configure.ac
+@@ -65,6 +65,25 @@ AC_SUBST(GCC_CFLAGS)
+ AC_CHECK_HEADERS([sys/prctl.h])
+ AC_CHECK_FUNCS([accept4 mkostemp posix_fallocate prctl])
  
 +AC_CHECK_HEADERS([sys/signalfd.h sys/timerfd.h])
 +
@@ -30,7 +28,7 @@ BSD support from FreeBSD
  AC_ARG_ENABLE([libraries],
  	      [AC_HELP_STRING([--disable-libraries],
  			      [Disable compilation of wayland libraries])],
-@@ -98,17 +117,21 @@ AC_SUBST([ICONDIR])
+@@ -100,17 +119,21 @@ AC_SUBST([ICONDIR])
  
  if test "x$enable_libraries" = "xyes"; then
  	PKG_CHECK_MODULES(FFI, [libffi])
@@ -46,11 +44,11 @@ BSD support from FreeBSD
  	AC_CHECK_DECL(CLOCK_MONOTONIC,[],
  		      [AC_MSG_ERROR("CLOCK_MONOTONIC is needed to compile wayland libraries")],
  		      [[#include <time.h>]])
- 	AC_CHECK_HEADERS([execinfo.h])
  fi
-+
+ 
 +EPOLLSHIM_LIBS="-lepoll-shim"
 +AC_SUBST(EPOLLSHIM_LIBS)
++
+ PKG_CHECK_MODULES(EXPAT, [expat])
  
- PKG_CHECK_MODULES(EXPAT, [expat], [],
- 	[AC_CHECK_HEADERS(expat.h, [],
+ AM_CONDITIONAL([DTD_VALIDATION], [test "x$enable_dtd_validation" = "xyes"])
diff --git a/wayland/patches/patch-src_wayland-server.c b/wayland/patches/patch-src_wayland-server.c
index 84d31d8ef7..ccb883c6da 100644
--- a/wayland/patches/patch-src_wayland-server.c
+++ b/wayland/patches/patch-src_wayland-server.c
@@ -2,7 +2,7 @@ $NetBSD$
 
 BSD support from FreeBSD
 
---- src/wayland-server.c.orig	2017-08-08 18:20:52 UTC
+--- src/wayland-server.c.orig	2019-03-21 00:55:25.000000000 +0000
 +++ src/wayland-server.c
 @@ -25,6 +25,8 @@
  
@@ -43,7 +43,17 @@ BSD support from FreeBSD
  	int error;
  	struct wl_priv_signal resource_created_signal;
  };
-@@ -501,10 +518,20 @@ wl_client_create(struct wl_display *disp
+@@ -312,7 +329,8 @@ wl_resource_post_error(struct wl_resourc
+ static void
+ destroy_client_with_error(struct wl_client *client, const char *reason)
+ {
+-	wl_log("%s (pid %u)\n", reason, client->ucred.pid);
++	wl_log("Destroying with error: %s\n", reason);
++	//wl_log("%s (pid %u)\n", reason, client->ucred.pid);
+ 	wl_client_destroy(client);
+ }
+ 
+@@ -526,10 +544,20 @@ wl_client_create(struct wl_display *disp
  	if (!client->source)
  		goto err_client;
  
@@ -64,7 +74,7 @@ BSD support from FreeBSD
  
  	client->connection = wl_connection_create(fd);
  	if (client->connection == NULL)
-@@ -558,12 +585,23 @@ WL_EXPORT void
+@@ -583,12 +611,23 @@ WL_EXPORT void
  wl_client_get_credentials(struct wl_client *client,
  			  pid_t *pid, uid_t *uid, gid_t *gid)
  {
diff --git a/wayland/patches/patch-src_wayland-shm.c b/wayland/patches/patch-src_wayland-shm.c
index bd9353ddd3..716fff861e 100644
--- a/wayland/patches/patch-src_wayland-shm.c
+++ b/wayland/patches/patch-src_wayland-shm.c
@@ -1,8 +1,6 @@
-$NetBSD$
-
-BSD support from FreeBSD
-
---- src/wayland-shm.c.orig	2017-08-08 18:20:52 UTC
+--- src/wayland-shm.c.orig	2018-04-09 17:19:26 UTC
++++ src/wayland-shm.c
+--- src/wayland-shm.c.orig	2019-03-21 00:55:25.000000000 +0000
 +++ src/wayland-shm.c
 @@ -30,6 +30,8 @@
  
@@ -49,7 +47,7 @@ BSD support from FreeBSD
  	if (data == MAP_FAILED) {
  		wl_resource_post_error(pool->resource,
  				       WL_SHM_ERROR_INVALID_FD,
-@@ -110,6 +124,10 @@ shm_pool_unref(struct wl_shm_pool *pool, bool external
+@@ -110,6 +124,10 @@ shm_pool_unref(struct wl_shm_pool *pool,
  	if (pool->internal_refcount + pool->external_refcount)
  		return;
  
@@ -60,7 +58,7 @@ BSD support from FreeBSD
  	munmap(pool->data, pool->size);
  	free(pool);
  }
-@@ -223,6 +241,73 @@ shm_pool_destroy(struct wl_client *client, struct wl_r
+@@ -223,6 +241,73 @@ shm_pool_destroy(struct wl_client *clien
  	wl_resource_destroy(resource);
  }
  
@@ -134,8 +132,8 @@ BSD support from FreeBSD
  static void
  shm_pool_resize(struct wl_client *client, struct wl_resource *resource,
  		int32_t size)
-@@ -284,7 +369,14 @@ shm_create_pool(struct wl_client *client, struct wl_re
- 				       "failed mmap fd %d", fd);
+@@ -284,7 +369,14 @@ shm_create_pool(struct wl_client *client
+ 				       "failed mmap fd %d: %m", fd);
  		goto err_free;
  	}
 +
diff --git a/wayland/patches/patch-tests_event-loop-test.c b/wayland/patches/patch-tests_event-loop-test.c
index 262df0b85f..ccd4f49fa5 100644
--- a/wayland/patches/patch-tests_event-loop-test.c
+++ b/wayland/patches/patch-tests_event-loop-test.c
@@ -2,7 +2,7 @@ $NetBSD$
 
 BSD support from FreeBSD
 
---- tests/event-loop-test.c.orig	2017-08-08 18:20:52 UTC
+--- tests/event-loop-test.c.orig	2019-03-21 00:55:25.000000000 +0000
 +++ tests/event-loop-test.c
 @@ -167,10 +167,10 @@ TEST(event_loop_signal)
  					  signal_callback, &got_it);
@@ -18,7 +18,7 @@ BSD support from FreeBSD
  	assert(got_it == 1);
  
  	wl_event_source_remove(source);
-@@ -234,11 +234,19 @@ TEST(event_loop_timer)
+@@ -234,12 +234,20 @@ TEST(event_loop_timer)
  
  	source = wl_event_loop_add_timer(loop, timer_callback, &got_it);
  	assert(source);
@@ -33,11 +33,12 @@ BSD support from FreeBSD
 +	* See: http://unix.derkeiler.com/Mailing-Lists/FreeBSD/hackers/2012-07/msg00319.html */
 +	assert(wl_event_loop_dispatch(loop, 50) == 0);
  	assert(got_it == 1);
-+
+ 
 +	/* Check it doesn't fire again. */
 +	got_it = 0;
 +	assert(wl_event_loop_dispatch(loop, 20) == 0);
 +	assert(!got_it);
- 
++
  	wl_event_source_remove(source);
  	wl_event_loop_destroy(loop);
+ }
diff --git a/wayland/patches/patch-tests_sanity-test.c b/wayland/patches/patch-tests_sanity-test.c
index 9769f85c91..13aef248c2 100644
--- a/wayland/patches/patch-tests_sanity-test.c
+++ b/wayland/patches/patch-tests_sanity-test.c
@@ -1,26 +1,25 @@
 $NetBSD$
 
-BSD support from FreeBSD
-
---- tests/sanity-test.c.orig	2016-02-17 01:13:16 UTC
+--- tests/sanity-test.c.orig	2019-03-21 00:55:25.000000000 +0000
 +++ tests/sanity-test.c
-@@ -92,7 +92,8 @@ FAIL_TEST(sanity_malloc_direct)
- TEST(disable_leak_checks)
+@@ -87,7 +87,8 @@ FAIL_TEST(sanity_fd_leak)
  {
- 	volatile void *mem;
--	assert(leak_check_enabled);
+ 	int fd[2];
+ 
+-	assert(fd_leak_check_enabled);
 +// XXX FreeBSD disables leak checks...
-+//	assert(leak_check_enabled);
- 	/* normally this should be on the beginning of the test.
- 	 * Here we need to be sure, that the leak checks are
- 	 * turned on */
-@@ -171,7 +172,8 @@ sanity_fd_no_leak(void)
++//	assert(fd_leak_check_enabled);
+ 
+ 	/* leak 2 file descriptors */
+ 	if (pipe(fd) < 0)
+@@ -124,8 +125,8 @@ static void
+ sanity_fd_no_leak(void)
  {
  	int fd[2];
- 
--	assert(leak_check_enabled);
-+// XXX FreeBSD leak checks are disabled
-+//	assert(leak_check_enabled);
+-
+-	assert(fd_leak_check_enabled);
++// XXX FreeBSD disables leak checks...
++//	assert(fd_leak_check_enabled);
  
  	/* leak 2 file descriptors */
  	if (pipe(fd) < 0)
diff --git a/wayland/patches/patch-tests_test-helpers.c b/wayland/patches/patch-tests_test-helpers.c
index 9acddfe798..917f92066e 100644
--- a/wayland/patches/patch-tests_test-helpers.c
+++ b/wayland/patches/patch-tests_test-helpers.c
@@ -1,12 +1,10 @@
-$NetBSD$
-
-BSD support from FreeBSD
-
---- tests/test-helpers.c.orig	2015-07-06 19:38:51 UTC
+--- tests/test-helpers.c.orig	2018-08-24 18:04:36 UTC
 +++ tests/test-helpers.c
-@@ -23,6 +23,12 @@
-  * SOFTWARE.
-  */
+--- tests/test-helpers.c.orig	2019-03-21 00:55:25.000000000 +0000
++++ tests/test-helpers.c
+@@ -25,6 +25,12 @@
+ 
+ #include "config.h"
  
 +#include "../config.h"
 +
@@ -17,7 +15,7 @@ BSD support from FreeBSD
  #include <assert.h>
  #include <errno.h>
  #include <dirent.h>
-@@ -32,6 +38,16 @@
+@@ -40,6 +46,16 @@
  
  #include "test-runner.h"
  
@@ -34,7 +32,7 @@ BSD support from FreeBSD
  int
  count_open_fds(void)
  {
-@@ -39,8 +55,8 @@ count_open_fds(void)
+@@ -47,8 +63,8 @@ count_open_fds(void)
  	struct dirent *ent;
  	int count = 0;
  
@@ -45,7 +43,7 @@ BSD support from FreeBSD
  
  	errno = 0;
  	while ((ent = readdir(dir))) {
-@@ -49,7 +65,7 @@ count_open_fds(void)
+@@ -57,7 +73,7 @@ count_open_fds(void)
  			continue;
  		count++;
  	}
diff --git a/wayland/patches/patch-tests_test-runner.c b/wayland/patches/patch-tests_test-runner.c
index 1fd58a4c80..0e6cbd6cf1 100644
--- a/wayland/patches/patch-tests_test-runner.c
+++ b/wayland/patches/patch-tests_test-runner.c
@@ -1,8 +1,6 @@
 $NetBSD$
 
-BSD support from FreeBSD
-
---- tests/test-runner.c.orig	2017-08-08 18:20:52 UTC
+--- tests/test-runner.c.orig	2019-03-21 00:55:25.000000000 +0000
 +++ tests/test-runner.c
 @@ -25,6 +25,12 @@
  
@@ -17,44 +15,36 @@ BSD support from FreeBSD
  #include <unistd.h>
  #include <stdio.h>
  #include <stdlib.h>
-@@ -37,19 +43,36 @@
+@@ -37,13 +43,28 @@
  #include <errno.h>
  #include <limits.h>
  #include <sys/ptrace.h>
-+#ifdef __linux__
++#ifdef HAVE_SYS_PRCTL_H
  #include <sys/prctl.h>
 +#endif
++#include <signal.h>
  #ifndef PR_SET_PTRACER
  # define PR_SET_PTRACER 0x59616d61
  #endif
-+#include <signal.h>
  
  #include "test-runner.h"
  
- static int num_alloc;
-+
-+extern const struct test __start_test_section, __stop_test_section;
-+
-+/* This is all disabled for FreeBSD because it gives "can't allocate initial
-+ * thread" aborts otherwise. */
-+#ifndef __FreeBSD__
- static void* (*sys_malloc)(size_t);
- static void (*sys_free)(void*);
- static void* (*sys_realloc)(void*, size_t);
- static void* (*sys_calloc)(size_t, size_t);
-+#endif
- 
-+#ifdef __FreeBSD__
-+/* XXX review ptrace() usage */
++#ifndef PTRACE_ATTACH
 +#define PTRACE_ATTACH PT_ATTACH
++#endif
++
++#ifndef PTRACE_CONT
 +#define PTRACE_CONT PT_CONTINUE
++#endif
++
++#ifndef PTRACE_DETACH
 +#define PTRACE_DETACH PT_DETACH
 +#endif
 +
- /* when set to 1, check if tests are not leaking memory and opened files.
+ /* when set to 1, check if tests are not leaking opened files.
   * It is turned on by default. It can be turned off by
   * WAYLAND_TEST_NO_LEAK_CHECK environment variable. */
-@@ -57,7 +80,7 @@ int leak_check_enabled;
+@@ -51,7 +72,7 @@ int fd_leak_check_enabled;
  
  /* when this var is set to 0, every call to test_set_timeout() is
   * suppressed - handy when debugging the test. Can be set by
@@ -63,23 +53,7 @@ BSD support from FreeBSD
  static int timeouts_enabled = 1;
  
  /* set to one if the output goes to the terminal */
-@@ -65,6 +88,7 @@ static int is_atty = 0;
- 
- extern const struct test __start_test_section, __stop_test_section;
- 
-+#ifndef __FreeBSD__
- __attribute__ ((visibility("default"))) void *
- malloc(size_t size)
- {
-@@ -98,6 +122,7 @@ calloc(size_t nmemb, size_t size)
- 
- 	return sys_calloc(nmemb, size);
- }
-+#endif
- 
- static const struct test *
- find_test(const char *name)
-@@ -292,6 +317,8 @@ is_debugger_attached(void)
+@@ -239,6 +260,8 @@ is_debugger_attached(void)
  		return 0;
  	}
  
@@ -88,7 +62,7 @@ BSD support from FreeBSD
  	pid = fork();
  	if (pid == -1) {
  		perror("fork");
-@@ -312,7 +339,7 @@ is_debugger_attached(void)
+@@ -259,13 +282,14 @@ is_debugger_attached(void)
  			_exit(1);
  		if (!waitpid(-1, NULL, 0))
  			_exit(1);
@@ -97,48 +71,35 @@ BSD support from FreeBSD
  		ptrace(PTRACE_DETACH, ppid, NULL, NULL);
  		_exit(0);
  	} else {
-@@ -346,17 +373,19 @@ int main(int argc, char *argv[])
- 	const struct test *t;
- 	pid_t pid;
+ 		close(pipefd[0]);
+ 
+ 		/* Enable child to ptrace the parent process */
++#if defined(HAVE_PRCTL)
+ 		rc = prctl(PR_SET_PTRACER, pid);
+ 		if (rc != 0 && errno != EINVAL) {
+ 			/* An error prevents us from telling if a debugger is attached.
+@@ -275,7 +299,9 @@ is_debugger_attached(void)
+ 			 */
+ 			perror("prctl");
+ 			write(pipefd[1], "-", 1);
+-		} else {
++		} else
++#endif
++		{
+ 			/* Signal to client that parent is ready by passing '+' */
+ 			write(pipefd[1], "+", 1);
+ 		}
+@@ -295,9 +321,6 @@ int main(int argc, char *argv[])
  	int total, pass;
-+#ifdef HAVE_WAITID
  	siginfo_t info;
-+#else
-+	int status;
-+#endif
- 
-+#ifndef __FreeBSD__
- 	/* Load system malloc, free, and realloc */
- 	sys_calloc = dlsym(RTLD_NEXT, "calloc");
- 	sys_realloc = dlsym(RTLD_NEXT, "realloc");
- 	sys_malloc = dlsym(RTLD_NEXT, "malloc");
- 	sys_free = dlsym(RTLD_NEXT, "free");
  
 -	if (isatty(fileno(stderr)))
 -		is_atty = 1;
 -
  	if (is_debugger_attached()) {
- 		leak_check_enabled = 0;
+ 		fd_leak_check_enabled = 0;
  		timeouts_enabled = 0;
-@@ -364,7 +393,17 @@ int main(int argc, char *argv[])
- 		leak_check_enabled = !getenv("WAYLAND_TEST_NO_LEAK_CHECK");
- 		timeouts_enabled = !getenv("WAYLAND_TEST_NO_TIMEOUTS");
- 	}
-+#else
-+	/* Disable leak checking on FreeBSD since we can't override malloc().  */
-+	leak_check_enabled = 0;
-+	/* XXX review later */
-+	timeouts_enabled = 0;
-+#endif
- 
-+	if (isatty(fileno(stderr)))
-+		is_atty = 1;
-+
-+
- 	if (argc == 2 && strcmp(argv[1], "--help") == 0)
- 		usage(argv[0], EXIT_SUCCESS);
- 
-@@ -395,7 +434,8 @@ int main(int argc, char *argv[])
+@@ -336,7 +359,8 @@ int main(int argc, char *argv[])
  		if (pid == 0)
  			run_test(t); /* never returns */
  
@@ -148,7 +109,7 @@ BSD support from FreeBSD
  			stderr_set_color(RED);
  			fprintf(stderr, "waitid failed: %m\n");
  			stderr_reset_color();
-@@ -426,6 +466,25 @@ int main(int argc, char *argv[])
+@@ -367,6 +391,25 @@ int main(int argc, char *argv[])
  
  			break;
  		}


Home | Main Index | Thread Index | Old Index