summaryrefslogtreecommitdiffstats
path: root/polyp/oss-util.c
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2006-01-12 16:04:21 +0000
committerPierre Ossman <ossman@cendio.se>2006-01-12 16:04:21 +0000
commitf61be8b654d33f3ab1b693c7e3a5d790617fbf6e (patch)
tree0d72eb60bf1e01ce47cf9e3aa8c35bf8c0a19c09 /polyp/oss-util.c
parent72316ccf9c8c7fec6fbd5d190852a61168002b24 (diff)
If the card couldn't do duplex when required we would incorrectly return
success from this function with a closed fd. git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@451 fefdeb5f-60dc-0310-8127-8f9354f1896f
Diffstat (limited to 'polyp/oss-util.c')
-rw-r--r--polyp/oss-util.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/polyp/oss-util.c b/polyp/oss-util.c
index 20a2965a..ae6772fd 100644
--- a/polyp/oss-util.c
+++ b/polyp/oss-util.c
@@ -57,7 +57,7 @@ int pa_oss_open(const char *device, int *mode, int* pcaps) {
if (*tcaps & DSP_CAP_DUPLEX)
return fd;
- close(fd);
+ goto fail;
}
if ((fd = open(device, (*mode = O_WRONLY)|O_NDELAY)) < 0) {
@@ -87,7 +87,7 @@ int pa_oss_open(const char *device, int *mode, int* pcaps) {
fail:
if (fd >= 0)
close(fd);
- return fd;
+ return -1;
}
int pa_oss_auto_format(int fd, pa_sample_spec *ss) {