repositories
/
deb_libcec.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added Doxyfile to generate Doxygen documentation. to update your copy of the document...
[deb_libcec.git]
/
src
/
lib
/
platform
/
posix
/
os-socket.h
diff --git
a/src/lib/platform/posix/os-socket.h
b/src/lib/platform/posix/os-socket.h
index 468cc3deb4dfa075a60bff9cd2ca899e8ac0d5d8..036be3f5c2227deffa92ea2250244cf350fb3fdd 100644
(file)
--- a/
src/lib/platform/posix/os-socket.h
+++ b/
src/lib/platform/posix/os-socket.h
@@
-43,6
+43,11
@@
#include <netdb.h>
#include <poll.h>
#include <netdb.h>
#include <poll.h>
+/* Needed on Mac OS/X */
+#ifndef SOL_TCP
+#define SOL_TCP IPPROTO_TCP
+#endif
+
namespace PLATFORM
{
// Standard sockets
namespace PLATFORM
{
// Standard sockets
@@
-71,7
+76,7
@@
namespace PLATFORM
if (socket == INVALID_SOCKET_VALUE)
{
*iError = EINVAL;
if (socket == INVALID_SOCKET_VALUE)
{
*iError = EINVAL;
- return -
1
;
+ return -
EINVAL
;
}
ssize_t iBytesWritten(0);
}
ssize_t iBytesWritten(0);
@@
-85,19
+90,19
@@
namespace PLATFORM
if (returnv < 0)
{
*iError = errno;
if (returnv < 0)
{
*iError = errno;
- return -
1
;
+ return -
errno
;
}
else if (returnv == 0)
{
*iError = ETIMEDOUT;
}
else if (returnv == 0)
{
*iError = ETIMEDOUT;
- return -
1
;
+ return -
ETIMEDOUT
;
}
returnv = write(socket, (char*)data + iBytesWritten, len - iBytesWritten);
if (returnv == -1)
{
*iError = errno;
}
returnv = write(socket, (char*)data + iBytesWritten, len - iBytesWritten);
if (returnv == -1)
{
*iError = errno;
- return -
1
;
+ return -
errno
;
}
iBytesWritten += returnv;
}
}
iBytesWritten += returnv;
}
@@
-116,7
+121,7
@@
namespace PLATFORM
if (socket == INVALID_SOCKET_VALUE)
{
*iError = EINVAL;
if (socket == INVALID_SOCKET_VALUE)
{
*iError = EINVAL;
- return -
1
;
+ return -
EINVAL
;
}
if (iTimeoutMs > 0)
}
if (iTimeoutMs > 0)
@@
-145,7
+150,7
@@
namespace PLATFORM
if (returnv == -1)
{
*iError = errno;
if (returnv == -1)
{
*iError = errno;
- return -
1
;
+ return -
errno
;
}
else if (returnv == 0)
{
}
else if (returnv == 0)
{
@@
-156,7
+161,7
@@
namespace PLATFORM
if (returnv == -1)
{
*iError = errno;
if (returnv == -1)
{
*iError = errno;
- return -
1
;
+ return -
errno
;
}
iBytesRead += returnv;
}
iBytesRead += returnv;
@@
-205,7
+210,7
@@
namespace PLATFORM
if (socket == INVALID_SOCKET_VALUE)
{
*iError = EINVAL;
if (socket == INVALID_SOCKET_VALUE)
{
*iError = EINVAL;
- return -
1
;
+ return -
EINVAL
;
}
if (iTimeoutMs > 0)
}
if (iTimeoutMs > 0)