Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c6f0a25d authored by San Mehat's avatar San Mehat Committed by The Android Open Source Project
Browse files

am df6c1b91: libsysutils: General clean up + disable build in simulator b

Merge commit 'df6c1b91'

* commit 'df6c1b91':
  libsysutils: General clean up + disable build in simulator builds
parents ef94ff4d df6c1b91
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
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
+0 −1
Original line number Diff line number Diff line
@@ -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))) {
+0 −2
Original line number Diff line number Diff line
@@ -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;
+3 −12
Original line number Diff line number Diff line
@@ -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;