More diagnostics. Fixed shm use.

This commit is contained in:
Abramo Bagnara 2000-10-14 19:43:14 +00:00
parent a380edd64f
commit 03f9565ef8
8 changed files with 157 additions and 130 deletions

View file

@ -295,8 +295,10 @@ int snd_pcm_link(snd_pcm_t *pcm1, snd_pcm_t *pcm2)
int fd2 = snd_pcm_link_descriptor(pcm2);
if (fd1 < 0 || fd2 < 0)
return -ENOSYS;
if (ioctl(fd1, SND_PCM_IOCTL_LINK, fd2) < 0)
if (ioctl(fd1, SND_PCM_IOCTL_LINK, fd2) < 0) {
SYSERR("SND_PCM_IOCTL_LINK failed");
return -errno;
}
return 0;
}
@ -309,11 +311,12 @@ int snd_pcm_unlink(snd_pcm_t *pcm)
fd = snd_pcm_poll_descriptor(pcm);
break;
default:
errno = -ENOSYS;
return -1;
return -ENOSYS;
}
if (ioctl(fd, SND_PCM_IOCTL_UNLINK) < 0)
if (ioctl(fd, SND_PCM_IOCTL_UNLINK) < 0) {
SYSERR("SND_PCM_IOCTL_UNLINK failed");
return -errno;
}
return 0;
}
@ -1047,12 +1050,14 @@ ssize_t snd_pcm_write_areas(snd_pcm_t *pcm, snd_pcm_channel_area_t *areas,
return err;
}
void snd_pcm_error(const char *file, int line, const char *function, const char *fmt, ...)
void snd_pcm_error(const char *file, int line, const char *function, int err, const char *fmt, ...)
{
va_list arg;
va_start(arg, fmt);
fprintf(stderr, "ALSA PCM lib %s:%i:(%s) ", file, line, function);
vfprintf(stderr, fmt, arg);
if (err)
fprintf(stderr, ": %s", snd_strerror(err));
putc('\n', stderr);
va_end(arg);
}