[pulseaudio-commits] configure.ac src/pulsecore
David Henningsson
diwic at kemper.freedesktop.org
Fri Nov 27 00:52:57 PST 2015
configure.ac | 2 +-
src/pulsecore/core-util.c | 7 +++++++
2 files changed, 8 insertions(+), 1 deletion(-)
New commits:
commit 3753f507557042f89b68fa4d48505a6c8887a021
Author: Kamil Rytarowski <n54 at gmx.com>
Date: Sat Nov 21 23:08:23 2015 +0100
netbsd: NetBSD ships with paccept(2) a superset of Linux-specific accept4()
[diwic: Moved paccept to #bsd line in configure.ac]
diff --git a/configure.ac b/configure.ac
index 003673e..abfb8d9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -569,7 +569,7 @@ AC_CHECK_FUNCS_ONCE([ctime_r usleep])
AC_CHECK_FUNCS_ONCE([strerror_r])
# BSD
-AC_CHECK_FUNCS_ONCE([lstat])
+AC_CHECK_FUNCS_ONCE([lstat paccept])
# Non-standard
AC_CHECK_FUNCS_ONCE([setresuid setresgid setreuid setregid seteuid setegid ppoll strsignal sig2str strtod_l pipe2 accept4])
diff --git a/src/pulsecore/core-util.c b/src/pulsecore/core-util.c
index 2099686..b5ddd3d 100644
--- a/src/pulsecore/core-util.c
+++ b/src/pulsecore/core-util.c
@@ -3501,6 +3501,8 @@ finish:
int pa_accept_cloexec(int sockfd, struct sockaddr *addr, socklen_t *addrlen) {
int fd;
+ errno = 0;
+
#ifdef HAVE_ACCEPT4
if ((fd = accept4(sockfd, addr, addrlen, SOCK_CLOEXEC)) >= 0)
goto finish;
@@ -3510,6 +3512,11 @@ int pa_accept_cloexec(int sockfd, struct sockaddr *addr, socklen_t *addrlen) {
#endif
+#ifdef HAVE_PACCEPT
+ if ((fd = paccept(sockfd, addr, addrlen, NULL, SOCK_CLOEXEC)) >= 0)
+ goto finish;
+#endif
+
if ((fd = accept(sockfd, addr, addrlen)) >= 0)
goto finish;
More information about the pulseaudio-commits
mailing list