summaryrefslogtreecommitdiffstats
path: root/src/network
diff options
context:
space:
mode:
authorŁukasz Matysiak <lukasz.matysiak@qt.io>2024-01-25 15:48:11 +0100
committerŁukasz Matysiak <lukasz.matysiak@qt.io>2024-01-28 00:35:30 +0100
commit1d46bb3c920a3e4c9fc4d09f759cd6ffae4080d1 (patch)
treeb53a91dc93639980843cc6b1d6ecf0dee0d38238 /src/network
parentfde57300ab51c7deda168f6a4515dcf7b1340618 (diff)
Handle EWOULDBLOCK the same way as EAGAIN when writing to sockets on Unix
On most platforms EWOULDBLOCK is defined to be equal to EAGAIN. However on some platforms (like VxWorks) it is not the case. Because of that, error returned from ::write is not handled properly on such platform. Since C++ does not allow duplicate switch labels, check if EWOULDBLOCK and EAGAIN have different values before adding EWOULDBLOCK to the switch statement. Task-number: QTBUG-115777 Pick-to: 6.7 Change-Id: I659cb946f239733f5c57b2000fb4e3d296ed9153 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/network')
-rw-r--r--src/network/socket/qnativesocketengine_unix.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/network/socket/qnativesocketengine_unix.cpp b/src/network/socket/qnativesocketengine_unix.cpp
index aef893d722..35c1b84ce7 100644
--- a/src/network/socket/qnativesocketengine_unix.cpp
+++ b/src/network/socket/qnativesocketengine_unix.cpp
@@ -1275,6 +1275,9 @@ qint64 QNativeSocketEnginePrivate::nativeWrite(const char *data, qint64 len)
setError(QAbstractSocket::RemoteHostClosedError, RemoteHostClosedErrorString);
q->close();
break;
+#if EWOULDBLOCK != EAGAIN
+ case EWOULDBLOCK:
+#endif
case EAGAIN:
writtenBytes = 0;
break;