From: Jaroslav Kysela Date: Tue, 11 Nov 2025 15:10:59 +0000 (+0100) Subject: seq: hw - notify if running mode / pversion ioctl fails X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=3ce629a4c2980e6d346ef435b415c354330950ce;p=alsa-lib.git seq: hw - notify if running mode / pversion ioctl fails Signed-off-by: Jaroslav Kysela --- diff --git a/src/seq/seq_hw.c b/src/seq/seq_hw.c index 29dd01fe..86dcb8da 100644 --- a/src/seq/seq_hw.c +++ b/src/seq/seq_hw.c @@ -541,8 +541,8 @@ int snd_seq_hw_open(snd_seq_t **handle, const char *name, int streams, int mode) return -errno; } if (ioctl(fd, SNDRV_SEQ_IOCTL_PVERSION, &ver) < 0) { - snd_errornum(SEQUENCER, "SNDRV_SEQ_IOCTL_PVERSION failed"); ret = -errno; + snd_errornum(SEQUENCER, "SNDRV_SEQ_IOCTL_PVERSION failed"); close(fd); return ret; } @@ -553,7 +553,8 @@ int snd_seq_hw_open(snd_seq_t **handle, const char *name, int streams, int mode) if (SNDRV_PROTOCOL_VERSION(1, 0, 3) <= ver) { /* inform the protocol version we're supporting */ unsigned int user_ver = SNDRV_SEQ_VERSION; - ioctl(fd, SNDRV_SEQ_IOCTL_USER_PVERSION, &user_ver); + if (ioctl(fd, SNDRV_SEQ_IOCTL_USER_PVERSION, &user_ver)) + snd_errornum(SEQUENCER, "cannot set user protocol version"); } hw = calloc(1, sizeof(snd_seq_hw_t)); if (hw == NULL) { @@ -620,7 +621,8 @@ int snd_seq_hw_open(snd_seq_t **handle, const char *name, int streams, int mode) run_mode.big_endian = 0; #endif run_mode.cpu_mode = sizeof(long); - ioctl(fd, SNDRV_SEQ_IOCTL_RUNNING_MODE, &run_mode); + if (ioctl(fd, SNDRV_SEQ_IOCTL_RUNNING_MODE, &run_mode)) + snd_warn(SEQUENCER, "running mode cannot be set"); } #endif