summaryrefslogtreecommitdiff
path: root/libsysutils/src/SocketClient.cpp
diff options
context:
space:
mode:
authorGuang Zhu <guangzhu@google.com>2012-02-07 19:13:28 -0800
committerGuang Zhu <guangzhu@google.com>2012-02-07 19:26:54 -0800
commita8185a622e368d1957e18a3ee9d29d45eda12cfc (patch)
treea98a179d56f71e2280e1b48f4cc5807fa630eac2 /libsysutils/src/SocketClient.cpp
parentdc58e73071aa829a5038caf37211f6b3e2d7b275 (diff)
Revert "New NativeDaemonConnector protocol adds a seqnum."
Reverting because it seems to break `adb reboot` This reverts commit dc58e73071aa829a5038caf37211f6b3e2d7b275. Change-Id: Ib8cc4379254694398cbb7f3e7a64c20e1ed8c1ba
Diffstat (limited to 'libsysutils/src/SocketClient.cpp')
-rw-r--r--libsysutils/src/SocketClient.cpp25
1 files changed, 4 insertions, 21 deletions
diff --git a/libsysutils/src/SocketClient.cpp b/libsysutils/src/SocketClient.cpp
index 6e270bd16..722dcb291 100644
--- a/libsysutils/src/SocketClient.cpp
+++ b/libsysutils/src/SocketClient.cpp
@@ -17,11 +17,9 @@ SocketClient::SocketClient(int socket, bool owned)
, mUid(-1)
, mGid(-1)
, mRefCount(1)
- , mCmdNum(0)
{
pthread_mutex_init(&mWriteMutex, NULL);
pthread_mutex_init(&mRefCountMutex, NULL);
- pthread_mutex_init(&mCmdNumMutex, NULL);
struct ucred creds;
socklen_t szCreds = sizeof(creds);
@@ -48,20 +46,19 @@ int SocketClient::sendMsg(int code, const char *msg, bool addErrno) {
const char* fmt;
char tmp[1];
int len;
- int cmdNum = getCmdNum();
if (addErrno) {
- fmt = "%d %.3d %s (%s)";
+ fmt = "%.3d %s (%s)";
arg = strerror(errno);
} else {
- fmt = "%d %.3d %s";
+ fmt = "%.3d %s";
arg = NULL;
}
/* Measure length of required buffer */
- len = snprintf(tmp, sizeof tmp, fmt, cmdNum, code, msg, arg);
+ len = snprintf(tmp, sizeof tmp, fmt, code, msg, arg);
/* Allocate in the stack, then write to it */
buf = (char*)alloca(len+1);
- snprintf(buf, len+1, fmt, cmdNum, code, msg, arg);
+ snprintf(buf, len+1, fmt, code, msg, arg);
/* Send the zero-terminated message */
return sendMsg(buf);
}
@@ -135,17 +132,3 @@ bool SocketClient::decRef() {
}
return deleteSelf;
}
-
-void SocketClient::setCmdNum(int cmdNum) {
- pthread_mutex_lock(&mCmdNumMutex);
- mCmdNum = cmdNum;
- pthread_mutex_unlock(&mCmdNumMutex);
-}
-
-int SocketClient::getCmdNum() {
- int ret;
- pthread_mutex_lock(&mCmdNumMutex);
- ret = mCmdNum;
- pthread_mutex_unlock(&mCmdNumMutex);
- return ret;
-}