summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSan Mehat <san@google.com>2009-05-13 08:58:43 -0700
committerSan Mehat <san@google.com>2009-05-13 09:10:01 -0700
commitdf6c1b91e3813886070f35929583c30cfaead918 (patch)
treeaa9d7343475a06953882893b929dd97a7704b17f
parent6fc287b6f6df62c73e1057e26475fec2837296cc (diff)
downloadsystem_core-df6c1b91e3813886070f35929583c30cfaead918.zip
system_core-df6c1b91e3813886070f35929583c30cfaead918.tar.gz
system_core-df6c1b91e3813886070f35929583c30cfaead918.tar.bz2
libsysutils: General clean up + disable build in simulator builds
Signed-off-by: San Mehat <san@google.com>
-rw-r--r--libsysutils/Android.mk9
-rw-r--r--libsysutils/src/FrameworkListener.cpp1
-rw-r--r--libsysutils/src/SocketClient.cpp2
-rw-r--r--libsysutils/src/SocketListener.cpp15
4 files changed, 12 insertions, 15 deletions
diff --git a/libsysutils/Android.mk b/libsysutils/Android.mk
index 59461da..2f3e106 100644
--- a/libsysutils/Android.mk
+++ b/libsysutils/Android.mk
@@ -1,3 +1,10 @@
+BUILD_LIBSYSUTILS := false
+ifneq ($(TARGET_SIMULATOR),true)
+ BUILD_LIBSYSUTILS := true
+endif
+
+ifeq ($(BUILD_LIBSYSUTILS),true)
+
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
@@ -23,3 +30,5 @@ ifeq ($(TARGET_SIMULATOR),true)
endif
include $(BUILD_SHARED_LIBRARY)
+
+endif
diff --git a/libsysutils/src/FrameworkListener.cpp b/libsysutils/src/FrameworkListener.cpp
index eb96c9a..71e0772 100644
--- a/libsysutils/src/FrameworkListener.cpp
+++ b/libsysutils/src/FrameworkListener.cpp
@@ -59,7 +59,6 @@ void FrameworkListener::registerCmd(FrameworkCommand *cmd) {
}
void FrameworkListener::dispatchCommand(SocketClient *cli, char *cmd) {
- LOGD("Dispatching '%s'", cmd);
char *cm, *last;
if (!(cm = strtok_r(cmd, ":", &last))) {
diff --git a/libsysutils/src/SocketClient.cpp b/libsysutils/src/SocketClient.cpp
index 930fa4c..ab020ca 100644
--- a/libsysutils/src/SocketClient.cpp
+++ b/libsysutils/src/SocketClient.cpp
@@ -28,8 +28,6 @@ int SocketClient::sendMsg(int code, char *msg, bool addErrno) {
}
int SocketClient::sendMsg(char *msg) {
- LOGD("SocketClient::sendMsg(%s)", msg);
-
if (mSocket < 0) {
errno = EHOSTUNREACH;
return -1;
diff --git a/libsysutils/src/SocketListener.cpp b/libsysutils/src/SocketListener.cpp
index 7e38546..acc4a67 100644
--- a/libsysutils/src/SocketListener.cpp
+++ b/libsysutils/src/SocketListener.cpp
@@ -61,10 +61,8 @@ int SocketListener::startListener() {
if (mListen && listen(mSock, 4) < 0) {
LOGE("Unable to listen on socket (%s)", strerror(errno));
return -1;
- } else if (!mListen) {
+ } else if (!mListen)
mClients->push_back(new SocketClient(mSock));
- LOGD("Created phantom client");
- }
if (pipe(mCtrlPipe))
return -1;
@@ -106,12 +104,7 @@ void SocketListener::runListener() {
while(1) {
SocketClientCollection::iterator it;
fd_set read_fds;
- struct timeval to;
int rc = 0;
-
- to.tv_sec = 60 * 60;
- to.tv_usec = 0;
-
int max = 0;
FD_ZERO(&read_fds);
@@ -133,14 +126,12 @@ void SocketListener::runListener() {
}
pthread_mutex_unlock(&mClientsLock);
- if ((rc = select(max + 1, &read_fds, NULL, NULL, &to)) < 0) {
+ if ((rc = select(max + 1, &read_fds, NULL, NULL, NULL)) < 0) {
LOGE("select failed (%s)", strerror(errno));
sleep(1);
continue;
- } else if (!rc) {
- LOGD("select timeout");
+ } else if (!rc)
continue;
- }
if (FD_ISSET(mCtrlPipe[0], &read_fds))
break;