am 7bb1b958: am ff856a2b: Merge "Add error handling to SocketClient::sendData"

* commit '7bb1b9585d2d61beaf05c997971aee27f87ad3f7':
  Add error handling to SocketClient::sendData
This commit is contained in:
Robert Greenwalt 2012-05-30 15:29:07 -07:00 committed by Android Git Automerger
commit 6f523cda13

View file

@ -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;
}