libsysutils: General clean up + disable build in simulator builds

Signed-off-by: San Mehat <san@google.com>
This commit is contained in:
San Mehat 2009-05-13 08:58:43 -07:00
parent 6fc287b6f6
commit df6c1b91e3
4 changed files with 12 additions and 15 deletions

View file

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

View file

@ -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))) {

View file

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

View file

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