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

Commit f31d2ed1 authored by Kenny Root's avatar Kenny Root
Browse files

Return false on socket read error

FrameworkListener was returning the errno from a function marked as
returning bool which caused an implicit conversion to true since we were
in an error block where errno was set to something non-zero.

This caused the clients that had errors to stick around forever and not
get removed from the set of file descriptors that SocketListener was
listening to.

Change-Id: Ia27a4cac47459f3a3c2bb6a7f66803a3165c894a
parent 09dd3e57
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -35,7 +35,7 @@ bool FrameworkListener::onDataAvailable(SocketClient *c) {

    if ((len = read(c->getSocket(), buffer, sizeof(buffer) -1)) < 0) {
        SLOGE("read() failed (%s)", strerror(errno));
        return errno;
        return false;
    } else if (!len)
        return false;