From 8f76d80fdec29b0fa4c7b4125d50edbef4d034f7 Mon Sep 17 00:00:00 2001 From: Jarkko Sakkinen Date: Thu, 24 Dec 2020 17:52:36 +0200 Subject: [PATCH] spa: Fix a compiler warning caused by unchecked read() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Wrap read() with the CHECK() used elsewhre in the test program, in order to render out the compiler warning represented by this transcript: ➜ pipewire (af38edea) ✔ make ninja -C /home/jarkko/Projects/pipewire/build ninja: Entering directory `/home/jarkko/Projects/pipewire/build' [6/397] Compiling C object spa/plugins/alsa/test-timer.p/test-timer.c.o ../spa/plugins/alsa/test-timer.c: In function ‘main’: ../spa/plugins/alsa/test-timer.c:195:3: warning: ignoring return value of ‘read’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 195 | read(state.timerfd, &expirations, sizeof(expirations)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Jarkko Sakkinen --- spa/plugins/alsa/test-timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spa/plugins/alsa/test-timer.c b/spa/plugins/alsa/test-timer.c index bd521cfbf..caa6b25e2 100644 --- a/spa/plugins/alsa/test-timer.c +++ b/spa/plugins/alsa/test-timer.c @@ -192,7 +192,7 @@ int main(int argc, char *argv[]) * this can be done in a poll loop as well */ while (true) { uint64_t expirations; - read(state.timerfd, &expirations, sizeof(expirations)); + CHECK(read(state.timerfd, &expirations, sizeof(expirations)), "read"); on_timer_wakeup(&state); }