repositories
/
deb_libcec.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
load and save the 2548:1002 config for XBMC too. try to create the profile directory...
[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..06df1e45888af8b5ba26037755808501fd571032 100644
(file)
--- a/
src/lib/platform/posix/os-socket.h
+++ b/
src/lib/platform/posix/os-socket.h
@@
-32,8
+32,8
@@
*/
*/
-#include "
..
/os.h"
-#include "
..
/util/timeutils.h"
+#include "
lib/platform
/os.h"
+#include "
lib/platform
/util/timeutils.h"
#include <stdio.h>
#include <fcntl.h>
#include <sys/socket.h>
#include <stdio.h>
#include <fcntl.h>
#include <sys/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);
@@
-81,23
+86,23
@@
namespace PLATFORM
{
FD_ZERO(&port);
FD_SET(socket, &port);
{
FD_ZERO(&port);
FD_SET(socket, &port);
-
int returnv =
select(socket + 1, NULL, &port, NULL, tv);
+
ssize_t returnv = (ssize_t)
select(socket + 1, NULL, &port, NULL, tv);
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)
@@
-140,12
+145,12
@@
namespace PLATFORM
FD_ZERO(&port);
FD_SET(socket, &port);
FD_ZERO(&port);
FD_SET(socket, &port);
-
int32_t returnv =
select(socket + 1, &port, NULL, NULL, tv);
+
ssize_t returnv = (ssize_t)
select(socket + 1, &port, NULL, NULL, tv);
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)
@@
-223,7
+228,7
@@
namespace PLATFORM
{
if (iTimeoutMs > 0)
{
{
if (iTimeoutMs > 0)
{
- int iPollResult = poll(&fds, 1,
iTarget - iNow
);
+ int iPollResult = poll(&fds, 1,
(int)(iTarget - iNow)
);
if (iPollResult == 0)
{
*iError = ETIMEDOUT;
if (iPollResult == 0)
{
*iError = ETIMEDOUT;
@@
-300,7
+305,7
@@
namespace PLATFORM
pfd.events = POLLOUT;
pfd.revents = 0;
pfd.events = POLLOUT;
pfd.revents = 0;
- int iPollResult = poll(&pfd, 1, iTimeout);
+ int iPollResult = poll(&pfd, 1,
(int)
iTimeout);
if (iPollResult == 0)
*iError = ETIMEDOUT;
else if (iPollResult == -1)
if (iPollResult == 0)
*iError = ETIMEDOUT;
else if (iPollResult == -1)