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 Change-Id: I659cb946f239733f5c57b2000fb4e3d296ed9153 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 1d46bb3c920a3e4c9fc4d09f759cd6ffae4080d1) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
5073c581af
commit
aca842ceb2
@ -1275,6 +1275,9 @@ qint64 QNativeSocketEnginePrivate::nativeWrite(const char *data, qint64 len)
|
|||||||
setError(QAbstractSocket::RemoteHostClosedError, RemoteHostClosedErrorString);
|
setError(QAbstractSocket::RemoteHostClosedError, RemoteHostClosedErrorString);
|
||||||
q->close();
|
q->close();
|
||||||
break;
|
break;
|
||||||
|
#if EWOULDBLOCK != EAGAIN
|
||||||
|
case EWOULDBLOCK:
|
||||||
|
#endif
|
||||||
case EAGAIN:
|
case EAGAIN:
|
||||||
writtenBytes = 0;
|
writtenBytes = 0;
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user