summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2021-03-31 13:23:22 -0600
committerJens Axboe <axboe@kernel.dk>2021-03-31 13:23:22 -0600
commitefa9efea0d360c91ac7d06125db711be26502b3a (patch)
tree5326235dbac97081bf73ff804f9fef7409c19757
parent2118351e6906c3f47723d2d31102bc2f1cd81b90 (diff)
downloadliburing-efa9efea0d360c91ac7d06125db711be26502b3a.tar.gz
liburing-efa9efea0d360c91ac7d06125db711be26502b3a.tar.bz2
test/ring-leak: get rid of warning on unchecked read
ring-leak.c: In function ‘test_iowq_request_cancel’: ring-leak.c:131:2: warning: ignoring return value of ‘read’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 131 | read(fds[0], buffer, 10); | ^~~~~~~~~~~~~~~~~~~~~~~~ We really don't care, but the warning is annoying. So get rid of it. Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--test/ring-leak.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/ring-leak.c b/test/ring-leak.c
index 7ff1d87..f8f043c 100644
--- a/test/ring-leak.c
+++ b/test/ring-leak.c
@@ -128,7 +128,9 @@ static int test_iowq_request_cancel(void)
* done async. For that rely on the registered write end to be closed
* after ring quiesce, so failing read from the other pipe end.
*/
- read(fds[0], buffer, 10);
+ ret = read(fds[0], buffer, 10);
+ if (ret < 0)
+ perror("read");
return 0;
}