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

This commit is contained in:
Nick Kralevich 2011-04-28 10:58:34 -07:00 committed by Android Code Review
commit a8728ee0f2

View file

@ -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;
}