Merge "Fix ioctl FIONREAD call parameters to use int instead of size_t" am: b17cdb26df am: 7e1af2dd40 am: 444bfb7482

Change-Id: I0c27609dece2ad20a4a3e4587566e1195f04b4c0
diff --git a/minui/events.cpp b/minui/events.cpp
index f331ed6..87f8112 100644
--- a/minui/events.cpp
+++ b/minui/events.cpp
@@ -90,9 +90,11 @@
 
   // The inotify will put one or several complete events.
   // Should not read part of one event.
-  size_t event_len;
-  int ret = ioctl(fd, FIONREAD, &event_len);
+  int event_len_int;
+  int ret = ioctl(fd, FIONREAD, &event_len_int);
   if (ret != 0) return -1;
+  if (event_len_int < 0) return -1;
+  size_t event_len = event_len_int;
 
   std::unique_ptr<DIR, decltype(&closedir)> dir(opendir(INPUT_DEV_DIR), closedir);
   if (!dir) {