spa: Fix a compiler warning caused by unchecked read()

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 <jarkko.sakkinen@iki.fi>
This commit is contained in:
Jarkko Sakkinen 2020-12-24 17:52:36 +02:00
parent af38edea82
commit 8f76d80fde

View file

@ -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);
}