]> git.alsa-project.org Git - alsa-utils.git/commit
alsactl, amidi: check write() return values to fix compile warnings
authorJaroslav Kysela <perex@perex.cz>
Fri, 4 Dec 2026 17:51:16 +0000 (18:51 +0100)
committerJaroslav Kysela <perex@perex.cz>
Fri, 4 Dec 2026 17:52:23 +0000 (18:52 +0100)
commit89149d8d7be6c8147e84c97cdd14fe8787ec5488
tree575a331ebb19f1ac16d50e802a1d550ba423aae0
parente531308d80503e980ed96e96ba8415cf35de8614
alsactl, amidi: check write() return values to fix compile warnings

Building with _FORTIFY_SOURCE emits -Wunused-result warnings because
write() is declared with the warn_unused_result attribute and its
return value was discarded (the (void) cast does not suppress it).

Consume and check the return values instead: in initfailed() report a
failure to open or write the state file, and in amidi's receive loop
report a short/failed write to the receive file and stop.

Closes: https://github.com/alsa-project/alsa-utils/pull/221
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
alsactl/utils.c
amidi/amidi.c