mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2026-02-05 04:06:34 -05:00
seq: hw - notify if running mode / pversion ioctl fails
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
122d362265
commit
3ce629a4c2
1 changed files with 5 additions and 3 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue