#include <hardware_legacy/uevent.h>
+#include <malloc.h>
#include <string.h>
#include <unistd.h>
#include <poll.h>
return (fd > 0);
}
+int uevent_get_fd()
+{
+ return fd;
+}
+
int uevent_next_event(char* buffer, int buffer_length)
{
while (1) {
fds.revents = 0;
nr = poll(&fds, 1, -1);
- if(nr > 0 && fds.revents == POLLIN) {
+ if(nr > 0 && (fds.revents & POLLIN)) {
int count = recv(fd, buffer, buffer_length, 0);
if (count > 0) {
struct uevent_handler *h;