summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Elder <paul.elder@ideasonboard.com>2019-07-12 17:25:59 +0900
committerPaul Elder <paul.elder@ideasonboard.com>2019-07-12 17:37:44 +0900
commitb5cffad2d48b0e0f280b7c132a10e0405a0aa50a (patch)
tree5d4fbf80a3cc7812c39b2e724e0c7624337091c9
parentdf23ab95f3d72c8a5eda7e6b831f7ee62e9394c4 (diff)
test: logging: fix compilation on Chromium OS
Commit a25c937f8afe ("test: add logging API test") causes the build to fail in the Chromium OS build environment, because the return value of a function call marked with the __warn_unused_result__ attribute is ignored. Fix this. Fixes: a25c937f8afe ("test: add logging API test") Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-rw-r--r--test/log.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/log.cpp b/test/log.cpp
index bc64325c..89fb5cad 100644
--- a/test/log.cpp
+++ b/test/log.cpp
@@ -59,7 +59,10 @@ protected:
char buf[1000];
memset(buf, 0, sizeof(buf));
lseek(fd, 0, SEEK_SET);
- read(fd, buf, sizeof(buf));
+ if (read(fd, buf, sizeof(buf)) < 0) {
+ cerr << "Failed to read tmp log file" << endl;
+ return TestFail;
+ }
close(fd);
std::list<int> goodList = { 1, 3, 5 };