Wed Aug 28 10:35:40 2019 UTC ()
wayland: declare wl_os_epoll_create_cloexec properly


(nia)
diff -r1.2 -r1.3 pkgsrc/devel/wayland/distinfo
diff -r1.1 -r1.2 pkgsrc/devel/wayland/patches/patch-src_wayland-os.c
diff -r1.1 -r1.2 pkgsrc/devel/wayland/patches/patch-src_wayland-os.h

cvs diff -r1.2 -r1.3 pkgsrc/devel/wayland/distinfo (expand / switch to unified diff)

--- pkgsrc/devel/wayland/distinfo 2019/08/19 12:50:23 1.2
+++ pkgsrc/devel/wayland/distinfo 2019/08/28 10:35:40 1.3
@@ -1,22 +1,22 @@ @@ -1,22 +1,22 @@
1$NetBSD: distinfo,v 1.2 2019/08/19 12:50:23 nia Exp $ 1$NetBSD: distinfo,v 1.3 2019/08/28 10:35:40 nia Exp $
2 2
3SHA1 (wayland-1.17.0.tar.xz) = 4d9e08a7a4a07fa37a25d7aa3ef83f08edec0600 3SHA1 (wayland-1.17.0.tar.xz) = 4d9e08a7a4a07fa37a25d7aa3ef83f08edec0600
4RMD160 (wayland-1.17.0.tar.xz) = 635494fb0f5d9eb1e782f98e08c3e0e26ff44268 4RMD160 (wayland-1.17.0.tar.xz) = 635494fb0f5d9eb1e782f98e08c3e0e26ff44268
5SHA512 (wayland-1.17.0.tar.xz) = c5051aab5ff078b368c196ecfedb33ccd961265bb914845d7ed81de361bb86ae18299575baa6c4eceb0d82cf8b495e8293f31b51d1cbc05d84af0a199ab3f946 5SHA512 (wayland-1.17.0.tar.xz) = c5051aab5ff078b368c196ecfedb33ccd961265bb914845d7ed81de361bb86ae18299575baa6c4eceb0d82cf8b495e8293f31b51d1cbc05d84af0a199ab3f946
6Size (wayland-1.17.0.tar.xz) = 437680 bytes 6Size (wayland-1.17.0.tar.xz) = 437680 bytes
7SHA1 (patch-Makefile.am) = af2c47eb2e1a4924ea842aeea1d0f00832762ec0 7SHA1 (patch-Makefile.am) = af2c47eb2e1a4924ea842aeea1d0f00832762ec0
8SHA1 (patch-configure.ac) = df15013a1639d673e5f0a86433a074f6201dbbc4 8SHA1 (patch-configure.ac) = df15013a1639d673e5f0a86433a074f6201dbbc4
9SHA1 (patch-cursor_os-compatibility.c) = 9aac1c734199bc7e33e7735356bc8dbc80fba89d 9SHA1 (patch-cursor_os-compatibility.c) = 9aac1c734199bc7e33e7735356bc8dbc80fba89d
10SHA1 (patch-src_event-loop.c) = 04d0eed4ba0708518201ec630dab97d52735fb0c 10SHA1 (patch-src_event-loop.c) = 04d0eed4ba0708518201ec630dab97d52735fb0c
11SHA1 (patch-src_wayland-os.c) = fc1a70d4baf8311afce92a081368104b7a732e27 11SHA1 (patch-src_wayland-os.c) = 7297f8259aea9603a7ba20fe58f79e3fd0042990
12SHA1 (patch-src_wayland-os.h) = 2e8fb20d4adfb3666adffe48104205488b4a1c7b 12SHA1 (patch-src_wayland-os.h) = 1e01dfadb5ed5889d76e024d30537935f33631a3
13SHA1 (patch-src_wayland-server.c) = 335de8f5390eb337dfbde26f523162bd44c06baf 13SHA1 (patch-src_wayland-server.c) = 335de8f5390eb337dfbde26f523162bd44c06baf
14SHA1 (patch-src_wayland-shm.c) = a59ddce3a161bb21fedb04737ff502da608b1da9 14SHA1 (patch-src_wayland-shm.c) = a59ddce3a161bb21fedb04737ff502da608b1da9
15SHA1 (patch-tests_client-test.c) = 6ffe18dfd64176a92f6f795eb757c54a3cf0ad10 15SHA1 (patch-tests_client-test.c) = 6ffe18dfd64176a92f6f795eb757c54a3cf0ad10
16SHA1 (patch-tests_connection-test.c) = af53116c99cbb8d6570bcec66bfd895c1ae01700 16SHA1 (patch-tests_connection-test.c) = af53116c99cbb8d6570bcec66bfd895c1ae01700
17SHA1 (patch-tests_event-loop-test.c) = 79909fdce7b73a7b19c58d3711329f6288fe7204 17SHA1 (patch-tests_event-loop-test.c) = 79909fdce7b73a7b19c58d3711329f6288fe7204
18SHA1 (patch-tests_os-wrappers-test.c) = 0b45e6952d23589e4991149143331fdb9e0386e1 18SHA1 (patch-tests_os-wrappers-test.c) = 0b45e6952d23589e4991149143331fdb9e0386e1
19SHA1 (patch-tests_queue-test.c) = 3ee8433faa50b033ab880d3c5b6a9846063d6bd6 19SHA1 (patch-tests_queue-test.c) = 3ee8433faa50b033ab880d3c5b6a9846063d6bd6
20SHA1 (patch-tests_sanity-test.c) = 80e06834ccf344fda16a6a8f85e062f2b4a744ec 20SHA1 (patch-tests_sanity-test.c) = 80e06834ccf344fda16a6a8f85e062f2b4a744ec
21SHA1 (patch-tests_test-helpers.c) = 1895c0bdadefdaeaa421e7051b71a297b3a5e2c3 21SHA1 (patch-tests_test-helpers.c) = 1895c0bdadefdaeaa421e7051b71a297b3a5e2c3
22SHA1 (patch-tests_test-runner.c) = 35d911064c1b65537ef2276797b8041fd6b023f7 22SHA1 (patch-tests_test-runner.c) = 35d911064c1b65537ef2276797b8041fd6b023f7

cvs diff -r1.1 -r1.2 pkgsrc/devel/wayland/patches/patch-src_wayland-os.c (expand / switch to unified diff)

--- pkgsrc/devel/wayland/patches/patch-src_wayland-os.c 2019/08/18 16:05:12 1.1
+++ pkgsrc/devel/wayland/patches/patch-src_wayland-os.c 2019/08/28 10:35:40 1.2
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1$NetBSD: patch-src_wayland-os.c,v 1.1 2019/08/18 16:05:12 nia Exp $ 1$NetBSD: patch-src_wayland-os.c,v 1.2 2019/08/28 10:35:40 nia Exp $
2 2
3BSD support from FreeBSD 3BSD support from FreeBSD
4 4
5https://lists.freedesktop.org/archives/wayland-devel/2019-February/040024.html 5https://lists.freedesktop.org/archives/wayland-devel/2019-February/040024.html
6 6
7--- src/wayland-os.c.orig 2019-03-21 00:55:25.000000000 +0000 7--- src/wayland-os.c.orig 2019-03-21 00:55:25.000000000 +0000
8+++ src/wayland-os.c 8+++ src/wayland-os.c
9@@ -25,14 +25,20 @@ 9@@ -25,14 +25,20 @@
10  10
11 #define _GNU_SOURCE 11 #define _GNU_SOURCE
12  12
13+#include "../config.h" 13+#include "../config.h"
14+ 14+
@@ -69,52 +69,51 @@ https://lists.freedesktop.org/archives/w @@ -69,52 +69,51 @@ https://lists.freedesktop.org/archives/w
69 { 69 {
70 int newfd; 70 int newfd;
71  71
72+#ifdef F_DUPFD_CLOEXEC 72+#ifdef F_DUPFD_CLOEXEC
73 newfd = fcntl(fd, F_DUPFD_CLOEXEC, minfd); 73 newfd = fcntl(fd, F_DUPFD_CLOEXEC, minfd);
74 if (newfd >= 0) 74 if (newfd >= 0)
75 return newfd; 75 return newfd;
76 if (errno != EINVAL) 76 if (errno != EINVAL)
77 return -1; 77 return -1;
78+#endif 78+#endif
79  79
80 newfd = fcntl(fd, F_DUPFD, minfd); 80 newfd = fcntl(fd, F_DUPFD, minfd);
81 return set_cloexec_or_close(newfd); 81 return set_cloexec_or_close(newfd);
82@@ -123,17 +153,20 @@ wl_os_recvmsg_cloexec(int sockfd, struct 82@@ -123,15 +153,18 @@ wl_os_recvmsg_cloexec(int sockfd, struct
83 { 83 {
84 ssize_t len; 84 ssize_t len;
85  85
86+#ifdef MSG_CMSG_CLOEXEC 86+#ifdef MSG_CMSG_CLOEXEC
87 len = recvmsg(sockfd, msg, flags | MSG_CMSG_CLOEXEC); 87 len = recvmsg(sockfd, msg, flags | MSG_CMSG_CLOEXEC);
88 if (len >= 0) 88 if (len >= 0)
89 return len; 89 return len;
90 if (errno != EINVAL) 90 if (errno != EINVAL)
91 return -1; 91 return -1;
92+#endif 92+#endif
93  93
94 return recvmsg_cloexec_fallback(sockfd, msg, flags); 94 return recvmsg_cloexec_fallback(sockfd, msg, flags);
95 } 95 }
96  96
97+#ifdef HAVE_SYS_EPOLL_H 97+#ifdef HAVE_SYS_EPOLL_H
98 int 98 int
99-wl_os_epoll_create_cloexec(void) 99 wl_os_epoll_create_cloexec(void)
100+wl_os_queue_create_cloexec(void) 
101 { 100 {
102 int fd; 101@@ -148,6 +181,18 @@ wl_os_epoll_create_cloexec(void)
103  
104@@ -148,6 +181,16 @@ wl_os_epoll_create_cloexec(void) 
105 fd = epoll_create(1); 102 fd = epoll_create(1);
106 return set_cloexec_or_close(fd); 103 return set_cloexec_or_close(fd);
107 } 104 }
108+#elif defined(HAVE_SYS_EVENT_H) 105+#endif
 106+
 107+#ifdef HAVE_SYS_EVENT_H
109+int 108+int
110+wl_os_queue_create_cloexec(void) 109+wl_os_queue_create_cloexec(void)
111+{ 110+{
112+ int fd; 111+ int fd;
113+ 112+
114+ fd = kqueue(); 113+ fd = kqueue();
115+ return set_cloexec_or_close(fd); 114+ return set_cloexec_or_close(fd);
116+} 115+}
117+#endif 116+#endif
118  117
119 int 118 int
120 wl_os_accept_cloexec(int sockfd, struct sockaddr *addr, socklen_t *addrlen) 119 wl_os_accept_cloexec(int sockfd, struct sockaddr *addr, socklen_t *addrlen)

cvs diff -r1.1 -r1.2 pkgsrc/devel/wayland/patches/Attic/patch-src_wayland-os.h (expand / switch to unified diff)

--- pkgsrc/devel/wayland/patches/Attic/patch-src_wayland-os.h 2019/08/18 16:05:12 1.1
+++ pkgsrc/devel/wayland/patches/Attic/patch-src_wayland-os.h 2019/08/28 10:35:40 1.2
@@ -1,33 +1,38 @@ @@ -1,33 +1,38 @@
1$NetBSD: patch-src_wayland-os.h,v 1.1 2019/08/18 16:05:12 nia Exp $ 1$NetBSD: patch-src_wayland-os.h,v 1.2 2019/08/28 10:35:40 nia Exp $
2 2
3BSD support from FreeBSD 3BSD support from FreeBSD
4 4
5https://lists.freedesktop.org/archives/wayland-devel/2019-February/040024.html 5https://lists.freedesktop.org/archives/wayland-devel/2019-February/040024.html
6 6
7--- src/wayland-os.h.orig 2019-03-21 00:55:25.000000000 +0000 7--- src/wayland-os.h.orig 2019-03-21 00:55:25.000000000 +0000
8+++ src/wayland-os.h 8+++ src/wayland-os.h
9@@ -26,17 +26,23 @@ 9@@ -26,17 +26,29 @@
10 #ifndef WAYLAND_OS_H 10 #ifndef WAYLAND_OS_H
11 #define WAYLAND_OS_H 11 #define WAYLAND_OS_H
12  12
13+#include "../config.h" 13+#include "../config.h"
14+ 14+
15 int 15 int
16 wl_os_socket_cloexec(int domain, int type, int protocol); 16 wl_os_socket_cloexec(int domain, int type, int protocol);
17  17
18 int 18 int
19+wl_os_socketpair_cloexec(int domain, int type, int protocol, int sv[2]); 19+wl_os_socketpair_cloexec(int domain, int type, int protocol, int sv[2]);
20+ 20+
21+int 21+int
22 wl_os_dupfd_cloexec(int fd, long minfd); 22 wl_os_dupfd_cloexec(int fd, long minfd);
23  23
24 ssize_t 24 ssize_t
25 wl_os_recvmsg_cloexec(int sockfd, struct msghdr *msg, int flags); 25 wl_os_recvmsg_cloexec(int sockfd, struct msghdr *msg, int flags);
26  26
27+ 27+#ifdef HAVE_SYS_EPOLL_H
28 int 28 int
29-wl_os_epoll_create_cloexec(void); 29 wl_os_epoll_create_cloexec(void);
 30+#endif
 31+
 32+#ifdef HAVE_SYS_EVENT_H
 33+int
30+wl_os_queue_create_cloexec(void); 34+wl_os_queue_create_cloexec(void);
 35+#endif
31  36
32 int 37 int
33 wl_os_accept_cloexec(int sockfd, struct sockaddr *addr, socklen_t *addrlen); 38 wl_os_accept_cloexec(int sockfd, struct sockaddr *addr, socklen_t *addrlen);