diff options
Diffstat (limited to 'libsysutils')
-rw-r--r-- | libsysutils/src/SocketClient.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libsysutils/src/SocketClient.cpp b/libsysutils/src/SocketClient.cpp index 4a1227f..3d4984d 100644 --- a/libsysutils/src/SocketClient.cpp +++ b/libsysutils/src/SocketClient.cpp @@ -131,11 +131,6 @@ char *SocketClient::quoteArg(const char *arg) { int SocketClient::sendMsg(const char *msg) { - if (mSocket < 0) { - errno = EHOSTUNREACH; - return -1; - } - // Send the message including null character if (sendData(msg, strlen(msg) + 1) != 0) { SLOGW("Unable to send msg '%s'", msg); @@ -158,6 +153,11 @@ int SocketClient::sendDataLocked(const void *data, int len) { const char *p = (const char*) data; int brtw = len; + if (mSocket < 0) { + errno = EHOSTUNREACH; + return -1; + } + if (len == 0) { return 0; } |