diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2017-02-09 20:24:23 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2017-02-09 23:40:56 +0800 |
commit | f9a818eaf8713f14f80576ea706d484d2bc92c7b (patch) | |
tree | 8081bde5a93d610c27d062142234cacfb71fff09 /test/RPCSession.cpp | |
parent | 5396c7692b87587dc35c07b2c6239782efd20739 (diff) | |
download | dexon-solidity-f9a818eaf8713f14f80576ea706d484d2bc92c7b.tar.gz dexon-solidity-f9a818eaf8713f14f80576ea706d484d2bc92c7b.tar.zst dexon-solidity-f9a818eaf8713f14f80576ea706d484d2bc92c7b.zip |
Detect closed sockets in IPC
Diffstat (limited to 'test/RPCSession.cpp')
-rw-r--r-- | test/RPCSession.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/test/RPCSession.cpp b/test/RPCSession.cpp index 8d18d118..9d046c4f 100644 --- a/test/RPCSession.cpp +++ b/test/RPCSession.cpp @@ -114,7 +114,8 @@ string IPCSocket::sendRequest(string const& _req) ssize_t ret = recv(m_socket, m_readBuf, sizeof(m_readBuf), 0); - if (ret < 0) + // Also consider closed socket an error. + if (ret <= 0) BOOST_FAIL("Reading on IPC failed"); return string(m_readBuf, m_readBuf + ret); |