Permalink
Browse files

Merge "libsysutils: only accept uevents from the kernel."

  • Loading branch information...
2 parents 52a6405 + 80b0162 commit a8728ee0f2e7927d7300a673946926ff82dd8ef3 @nickkral nickkral committed with Android Code Review Apr 28, 2011
Showing with 2 additions and 1 deletion.
  1. +2 −1 libsysutils/src/NetlinkListener.cpp
@@ -21,6 +21,7 @@
#define LOG_TAG "NetlinkListener"
#include <cutils/log.h>
+#include <cutils/uevent.h>
#include <sysutils/NetlinkListener.h>
#include <sysutils/NetlinkEvent.h>
@@ -34,7 +35,7 @@ bool NetlinkListener::onDataAvailable(SocketClient *cli)
int socket = cli->getSocket();
int count;
- if ((count = recv(socket, mBuffer, sizeof(mBuffer), 0)) < 0) {
+ if ((count = uevent_checked_recv(socket, mBuffer, sizeof(mBuffer))) < 0) {
SLOGE("recv failed (%s)", strerror(errno));
return false;
}

0 comments on commit a8728ee

Please sign in to comment.