summaryrefslogtreecommitdiffstats
path: root/src/network/socket/qnet_unix_p.h
diff options
context:
space:
mode:
authorRalf Nolden <nolden@kde.org>2016-06-27 10:34:19 +0200
committerRalf Nolden <nolden@kde.org>2016-06-28 05:49:18 +0000
commitb3b2f502e9b499814a1e3b21e1b572e3ff1ba37b (patch)
tree03db9966160201198965078b4d00e296c1281332 /src/network/socket/qnet_unix_p.h
parent1a96295755391b508ea37b4bfbb681ea15ed7559 (diff)
NetBSD: use paccept() where accept4() is used
Where accept4() is used, NetBSD offers paccept() as a replacement function. Modify check for using accept4() and use paccept() on NetBSD. See http://netbsd.gw.com/cgi-bin/man-cgi?paccept++NetBSD-current and http://reviews.llvm.org/D12485 Change-Id: I9b3ecba5f3afad6c357d3f7b8f89589bf313e273 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/network/socket/qnet_unix_p.h')
-rw-r--r--src/network/socket/qnet_unix_p.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/network/socket/qnet_unix_p.h b/src/network/socket/qnet_unix_p.h
index 9626c53711..1481f565d4 100644
--- a/src/network/socket/qnet_unix_p.h
+++ b/src/network/socket/qnet_unix_p.h
@@ -109,7 +109,11 @@ static inline int qt_safe_accept(int s, struct sockaddr *addr, QT_SOCKLEN_T *add
int sockflags = SOCK_CLOEXEC;
if (flags & O_NONBLOCK)
sockflags |= SOCK_NONBLOCK;
+# if defined(Q_OS_NETBSD)
+ fd = ::paccept(s, addr, static_cast<QT_SOCKLEN_T *>(addrlen), NULL, sockflags);
+# else
fd = ::accept4(s, addr, static_cast<QT_SOCKLEN_T *>(addrlen), sockflags);
+# endif
return fd;
#else
fd = ::accept(s, addr, static_cast<QT_SOCKLEN_T *>(addrlen));