summaryrefslogtreecommitdiff
path: root/test/event-thread.cpp
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2019-08-18 02:15:22 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2019-08-19 19:06:37 +0300
commit57baad97b9ec1cf79c86720204d9185d0ac265c9 (patch)
tree0d6d9fd486e23079a9780e86a43b089f77c25ca5 /test/event-thread.cpp
parentaf49b18c81a3998b59b1aae0daa16ec5050e44fc (diff)
test: event-thread: Fix compilation on Chromium OS
Commit 92b4af98cd67 ("test: Add EventNotifier thread move test") causes the build to fail in the Chromium OS build environment, because the return values of the pipe() function marked with the __warn_unused_result__ attribute is ignored. Fix this. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Diffstat (limited to 'test/event-thread.cpp')
-rw-r--r--test/event-thread.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/test/event-thread.cpp b/test/event-thread.cpp
index 714bc984..01120733 100644
--- a/test/event-thread.cpp
+++ b/test/event-thread.cpp
@@ -25,7 +25,11 @@ public:
EventHandler()
: notified_(false)
{
- pipe(pipefd_);
+ int ret = pipe(pipefd_);
+ if (ret < 0) {
+ ret = errno;
+ cout << "pipe() failed: " << strerror(ret) << endl;
+ }
notifier_ = new EventNotifier(pipefd_[0], EventNotifier::Read, this);
notifier_->activated.connect(this, &EventHandler::readReady);