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

Commit 86e5880d authored by Hao Chen's avatar Hao Chen
Browse files

Log and return error if failed to listen to a socket

Test: build by `mm`

Change-Id: I5cf38c4011274ff70a02ac7472a10670b779aa85
parent 9cd7668f
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -92,7 +92,10 @@ bool SocketComm::listen() {
    }

    ALOGI("%s: Listening for connections on port %d", __FUNCTION__, DEBUG_SOCKET);
    ::listen(mListenFd, 1);
    if (::listen(mListenFd, 1) == -1) {
        ALOGE("%s: Error on listening: errno: %d: %s", __FUNCTION__, errno, strerror(errno));
        return false;
    }
    return true;
}