summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenny Root2010-09-14 11:55:22 -0500
committerKenny Root2010-09-14 11:55:22 -0500
commitf31d2ed1fd3a39a92bccc12eb66728594290ef3b (patch)
tree7cff1f0796d7ff93ccdf3ae8cd3ac4022e932072
parent09dd3e57b920c8f65cb486313a4c0f35b8cb9f46 (diff)
downloadplatform-system-core-f31d2ed1fd3a39a92bccc12eb66728594290ef3b.tar.gz
platform-system-core-f31d2ed1fd3a39a92bccc12eb66728594290ef3b.tar.xz
platform-system-core-f31d2ed1fd3a39a92bccc12eb66728594290ef3b.zip
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
-rw-r--r--libsysutils/src/FrameworkListener.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/libsysutils/src/FrameworkListener.cpp b/libsysutils/src/FrameworkListener.cpp
index 80f678d0a..640b6df25 100644
--- a/libsysutils/src/FrameworkListener.cpp
+++ b/libsysutils/src/FrameworkListener.cpp
@@ -35,7 +35,7 @@ bool FrameworkListener::onDataAvailable(SocketClient *c) {
35 35
36 if ((len = read(c->getSocket(), buffer, sizeof(buffer) -1)) < 0) { 36 if ((len = read(c->getSocket(), buffer, sizeof(buffer) -1)) < 0) {
37 SLOGE("read() failed (%s)", strerror(errno)); 37 SLOGE("read() failed (%s)", strerror(errno));
38 return errno; 38 return false;
39 } else if (!len) 39 } else if (!len)
40 return false; 40 return false;
41 41