OSDN Git Service

Return status in HWCPoll.
authorMunish Bhardwaj <munishx.bhardwaj@intel.com>
Wed, 20 Sep 2017 01:46:54 +0000 (07:16 +0530)
committerKalyan Kondapally <kalyan.kondapally@intel.com>
Sun, 24 Sep 2017 02:18:31 +0000 (19:18 -0700)
Jira: None
Test: poll status is available to caller
Signed-off-by: Munish Bhardwaj <munishx.bhardwaj@intel.com>
common/utils/hwcutils.cpp
common/utils/hwcutils.h

index 71cdf62..95c5ad8 100644 (file)
 
 namespace hwcomposer {
 
-void HWCPoll(int fd, int timeout) {
+int HWCPoll(int fd, int timeout) {
   CTRACE();
+  int ret;
   struct pollfd fds[1];
   fds[0].fd = fd;
   fds[0].events = POLLIN;
 
-  if (poll(fds, 1, timeout) <= 0) {
+  if ((ret = poll(fds, 1, timeout)) <= 0) {
     ETRACE("Poll Failed in HWCPoll %s", PRINTERROR());
   }
+ return ret;
 }
 
 }  // namespace hwcomposer
index d42deaa..7a327ca 100644 (file)
@@ -24,7 +24,7 @@ namespace hwcomposer {
 // Call poll() on fd.
 //  - timeout: time in miliseconds to stay blocked before returning if fd
 //  is not ready.
-void HWCPoll(int fd, int timeout);
+int HWCPoll(int fd, int timeout);
 
 }  // namespace hwcomposer