From b5cffad2d48b0e0f280b7c132a10e0405a0aa50a Mon Sep 17 00:00:00 2001 From: Paul Elder Date: Fri, 12 Jul 2019 17:25:59 +0900 Subject: 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 Reviewed-by: Laurent Pinchart --- test/log.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'test') 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 goodList = { 1, 3, 5 }; -- cgit v1.2.1