From 308b9f57268f3ca54a6446b287707459e8a51c26 Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Wed, 18 Dec 2019 16:50:03 +0000 Subject: [PATCH] remove redundant libc suplements from qcore_unix_p header Signed-off-by: Ivailo Monev --- src/core/kernel/qcore_unix_p.h | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/src/core/kernel/qcore_unix_p.h b/src/core/kernel/qcore_unix_p.h index 095bdb966..b93d945ab 100644 --- a/src/core/kernel/qcore_unix_p.h +++ b/src/core/kernel/qcore_unix_p.h @@ -56,26 +56,6 @@ #include #include -struct sockaddr; - -#if defined(Q_OS_LINUX) && defined(O_CLOEXEC) -# define QT_UNIX_SUPPORTS_THREADSAFE_CLOEXEC 1 -QT_BEGIN_NAMESPACE -namespace QtLibcSupplement { - inline int accept4(int, sockaddr *, QT_SOCKLEN_T *, int) - { errno = ENOSYS; return -1; } - inline int dup3(int, int, int) - { errno = ENOSYS; return -1; } - inline int pipe2(int [], int ) - { errno = ENOSYS; return -1; } -} -QT_END_NAMESPACE -using namespace QT_PREPEND_NAMESPACE(QtLibcSupplement); - -#else -# define QT_UNIX_SUPPORTS_THREADSAFE_CLOEXEC 0 -#endif - #define EINTR_LOOP(var, cmd) \ do { \ var = cmd; \ @@ -179,7 +159,7 @@ static inline int qt_safe_pipe(int pipefd[2], int flags = 0) #endif int ret; -#if QT_UNIX_SUPPORTS_THREADSAFE_CLOEXEC && defined(O_CLOEXEC) +#if defined(Q_OS_LINUX) && defined(O_CLOEXEC) // use pipe2 flags |= O_CLOEXEC; ret = ::pipe2(pipefd, flags); // pipe2 is Linux-specific and is documented not to return EINTR @@ -233,7 +213,7 @@ static inline int qt_safe_dup2(int oldfd, int newfd, int flags = FD_CLOEXEC) Q_ASSERT(flags == FD_CLOEXEC || flags == 0); int ret; -#if QT_UNIX_SUPPORTS_THREADSAFE_CLOEXEC && defined(O_CLOEXEC) +#if defined(Q_OS_LINUX) && defined(O_CLOEXEC) // use dup3 if (flags & FD_CLOEXEC) { EINTR_LOOP(ret, ::dup3(oldfd, newfd, O_CLOEXEC)); -- 2.11.0