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>
This commit is contained in:
parent
fde57300ab
commit
1d46bb3c92
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user