]> code.delx.au - pulseaudio/commitdiff
If the card couldn't do duplex when required we would incorrectly return
authorPierre Ossman <ossman@cendio.se>
Thu, 12 Jan 2006 16:04:21 +0000 (16:04 +0000)
committerPierre Ossman <ossman@cendio.se>
Thu, 12 Jan 2006 16:04:21 +0000 (16:04 +0000)
success from this function with a closed fd.

git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@451 fefdeb5f-60dc-0310-8127-8f9354f1896f

polyp/oss-util.c

index 20a2965a32ce89e51f3766a6d34cfb4ef8e5d55b..ae6772fd9b1345f4f094697f52fc1aeeb1711dea 100644 (file)
@@ -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) {