summaryrefslogtreecommitdiffstats
path: root/remote-processor
diff options
context:
space:
mode:
authorKevin Rocard <kevinx.rocard@intel.com>2014-04-24 15:14:53 +0200
committerMattijs Korpershoek <mattijsx.korpershoek@intel.com>2014-06-25 10:52:27 +0200
commit3dd67addc686e490ac4b710250d1d5fca4ca0729 (patch)
tree2ea1aeb31022ea829e4f0dcec26fad8834d0970b /remote-processor
parenta17d5a584a9b681e2eb48465815d275eb5fccb8f (diff)
downloadexternal_parameter-framework-3dd67addc686e490ac4b710250d1d5fca4ca0729.zip
external_parameter-framework-3dd67addc686e490ac4b710250d1d5fca4ca0729.tar.gz
external_parameter-framework-3dd67addc686e490ac4b710250d1d5fca4ca0729.tar.bz2
Remote-processor send returning 0 is not an error
BZ: 190038 Send can return a 0 size, it is normal. Does not consider send return value 0 as an error. Change-Id: Ic4801908b0771d5e0aba8c090fb9e9949d6e16fc Signed-off-by: Kevin Rocard <kevinx.rocard@intel.com>
Diffstat (limited to 'remote-processor')
-rw-r--r--remote-processor/Socket.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/remote-processor/Socket.cpp b/remote-processor/Socket.cpp
index d79b45a..3530453 100644
--- a/remote-processor/Socket.cpp
+++ b/remote-processor/Socket.cpp
@@ -111,6 +111,9 @@ bool CSocket::read(void* pvData, uint32_t uiSize)
if (!iAccessedSize || iAccessedSize == -1) {
+ // recv return value is 0 when the peer has performed an orderly shutdown.
+ // -1 if an error occurred
+ // In both case the read could not be achieve
return false;
}
uiSize -= iAccessedSize;
@@ -129,7 +132,8 @@ bool CSocket::write(const void* pvData, uint32_t uiSize)
int32_t iAccessedSize = ::send(_iSockFd, &pucData[uiOffset], uiSize, MSG_NOSIGNAL);
- if (!iAccessedSize || iAccessedSize == -1) {
+ // Return value of 0 is not an error
+ if (iAccessedSize == -1) {
return false;
}