From 3b1d8a54f973a306849fe08dbd8c24edad69bcab Mon Sep 17 00:00:00 2001 From: Takashi Sakamoto Date: Sat, 12 Jul 2025 17:00:06 +0900 Subject: [PATCH] seq: fix return value when failing devnode detection of ALSA Sequencer character device MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- src/seq/query.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- 2.47.3