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>
gboolean result;
if (!alsaseq_get_seq_devnode(&devname, error))
- return -1;
+ return FALSE;
result = TRUE;
*fd = open(devname, O_RDONLY);