test: Fixed the compilation issue
The return value of write() function is ignored, causing the following compiler error|warning with gcc version 5.4 error: ignoring return value of 'ssize_t write(int, const void*, size_t)' Fix this by storing the return value of write() and return a test error in case of failure. Reported-by: Coverity CID=284605 Signed-off-by: Madhavan Krishnan <madhavan.krishnan@linaro.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
parent
e239ded90b
commit
5f2f9406ce
1 changed files with 3 additions and 2 deletions
|
@ -30,10 +30,11 @@ protected:
|
|||
if (fd == -1)
|
||||
return TestFail;
|
||||
|
||||
write(fd, "libcamera", 9);
|
||||
ssize_t ret = write(fd, "libcamera", 9);
|
||||
|
||||
close(fd);
|
||||
|
||||
return TestPass;
|
||||
return ret == 9 ? TestPass : TestFail;
|
||||
}
|
||||
|
||||
int run()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue