summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel
diff options
context:
space:
mode:
authorMikhail Svetkin <mikhail.svetkin@qt.io>2018-03-20 14:41:48 +0100
committerMikhail Svetkin <mikhail.svetkin@qt.io>2019-06-05 08:21:52 +0000
commitc66c4a844f7fcdc071fb5b57474a3d1cd54047c0 (patch)
tree2f06df2439acb1476643a29da7365a2e320063aa /src/corelib/kernel
parent972a0402be4d7aed0ebbd0ff56b5018cda01599d (diff)
rtems: Fix detection bad file descriptor
RTEMS does not support poll/select and etc for files and fcntl(fd, F_GETFD) can not say that. Change-Id: If5ad160cd81e347fac72d2bafcb5b5bb815ed059 Reviewed-by: Ryan Chu <ryan.chu@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/corelib/kernel')
-rw-r--r--src/corelib/kernel/qpoll.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/corelib/kernel/qpoll.cpp b/src/corelib/kernel/qpoll.cpp
index 8e93c4d363..8b87bfe79d 100644
--- a/src/corelib/kernel/qpoll.cpp
+++ b/src/corelib/kernel/qpoll.cpp
@@ -39,6 +39,10 @@
#include "qcore_unix_p.h"
+#ifdef Q_OS_RTEMS
+#include <rtems/rtems_bsdnet_internal.h>
+#endif
+
QT_BEGIN_NAMESPACE
#define QT_POLL_READ_MASK (POLLIN | POLLRDNORM)
@@ -135,6 +139,11 @@ static inline int qt_poll_sweep(struct pollfd *fds, nfds_t nfds,
static inline bool qt_poll_is_bad_fd(int fd)
{
+#ifdef Q_OS_RTEMS
+ if (!rtems_bsdnet_fdToSocket(fd))
+ return true;
+#endif
+
int ret;
EINTR_LOOP(ret, fcntl(fd, F_GETFD));
return (ret == -1 && errno == EBADF);