mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-24 02:42:55 +00:00
remove redundant libc suplements from qcore_unix_p header
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
This commit is contained in:
parent
34d5041594
commit
308b9f5726
1 changed files with 2 additions and 22 deletions
|
@ -56,26 +56,6 @@
|
|||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
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));
|
||||
|
|
Loading…
Add table
Reference in a new issue