]> git.alsa-project.org Git - alsa-gobject.git/commit
seq: fix return value when failing devnode detection of ALSA Sequencer character...
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>
Sat, 12 Jul 2025 08:00:06 +0000 (17:00 +0900)
committerTakashi Sakamoto <o-takashi@sakamocchi.jp>
Sat, 12 Jul 2025 12:31:59 +0000 (21:31 +0900)
commit3b1d8a54f973a306849fe08dbd8c24edad69bcab
tree9c3bf7589da16574eecd222a2258847e3c07f4d9
parenta81b71751785aa3562794c92d91da4b0b3afe06c
seq: fix return value when failing devnode detection of ALSA Sequencer character device

When failing detecting devnode of ALSA Sequencer character device, the
helper function returns negative value to the callers. This is overlooked
in the previous code refactoring. It should return FALSE.

This bug brings the following compiler warnings:

../src/seq/query.c: In function ‘alsaseq_get_system_info’:
../src/seq/query.c:113:9: warning: ‘fd’ may be used uninitialized [-Wmaybe-uninitialized]
  113 |     if (ioctl(fd, SNDRV_SEQ_IOCTL_SYSTEM_INFO, info) < 0) {
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/seq/query.c:101:9: note: ‘fd’ was declared here
  101 |     int fd;
      |

This commit fixes the bug.

Fixes: 31eb1a62345c ("seq: query: rewrite public API to return gboolean according to GNOME convention")
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
src/seq/query.c