X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Flib%2Fplatform%2Fposix%2Fos-socket.h;h=036be3f5c2227deffa92ea2250244cf350fb3fdd;hb=90cfaac2259efb20d92744578657c85c6f20b786;hp=30be947159d2fe9c64ed90f30be9e8fa7ee31799;hpb=1a47476aaf672a655ad19333e321c5e3b8efb73b;p=deb_libcec.git diff --git a/src/lib/platform/posix/os-socket.h b/src/lib/platform/posix/os-socket.h index 30be947..036be3f 100644 --- a/src/lib/platform/posix/os-socket.h +++ b/src/lib/platform/posix/os-socket.h @@ -76,7 +76,7 @@ namespace PLATFORM if (socket == INVALID_SOCKET_VALUE) { *iError = EINVAL; - return -1; + return -EINVAL; } ssize_t iBytesWritten(0); @@ -90,19 +90,19 @@ namespace PLATFORM if (returnv < 0) { *iError = errno; - return -1; + return -errno; } else if (returnv == 0) { *iError = ETIMEDOUT; - return -1; + return -ETIMEDOUT; } returnv = write(socket, (char*)data + iBytesWritten, len - iBytesWritten); if (returnv == -1) { *iError = errno; - return -1; + return -errno; } iBytesWritten += returnv; } @@ -121,7 +121,7 @@ namespace PLATFORM if (socket == INVALID_SOCKET_VALUE) { *iError = EINVAL; - return -1; + return -EINVAL; } if (iTimeoutMs > 0) @@ -150,7 +150,7 @@ namespace PLATFORM if (returnv == -1) { *iError = errno; - return -1; + return -errno; } else if (returnv == 0) { @@ -161,7 +161,7 @@ namespace PLATFORM if (returnv == -1) { *iError = errno; - return -1; + return -errno; } iBytesRead += returnv; @@ -210,7 +210,7 @@ namespace PLATFORM if (socket == INVALID_SOCKET_VALUE) { *iError = EINVAL; - return -1; + return -EINVAL; } if (iTimeoutMs > 0)