From: Takashi Sakamoto Date: Sat, 12 Jul 2025 08:00:06 +0000 (+0900) Subject: seq: fix return value when failing devnode detection of ALSA Sequencer character... X-Git-Tag: v0.3.1~2 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=fd571ef413ed63b84e02e2e598839222c4a58f28;p=alsa-gobject.git 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 --- diff --git a/src/seq/query.c b/src/seq/query.c index b49c99b..feddfda 100644 --- a/src/seq/query.c +++ b/src/seq/query.c @@ -70,7 +70,7 @@ static gboolean open_fd(int *fd, GError **error) gboolean result; if (!alsaseq_get_seq_devnode(&devname, error)) - return -1; + return FALSE; result = TRUE; *fd = open(devname, O_RDONLY);