Permalink
Browse files

am 7bb1b95: am ff856a2: Merge "Add error handling to SocketClient::se…

…ndData"

* commit '7bb1b9585d2d61beaf05c997971aee27f87ad3f7':
  Add error handling to SocketClient::sendData
  • Loading branch information...
2 parents 99565a9 + 7bb1b95 commit 6f523cda13094bf493cdf37e7ecc480bb5a37a2b Robert Greenwalt committed with Android Git Automerger May 30, 2012
Showing with 5 additions and 5 deletions.
  1. +5 −5 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;
}

0 comments on commit 6f523cd

Please sign in to comment.