]> code.delx.au - pulseaudio/commitdiff
Report IO error on ioctl() when we're in a fatal error state.
authorPierre Ossman <ossman@cendio.se>
Thu, 4 Jan 2007 14:20:53 +0000 (14:20 +0000)
committerPierre Ossman <ossman@cendio.se>
Thu, 4 Jan 2007 14:20:53 +0000 (14:20 +0000)
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1421 fefdeb5f-60dc-0310-8127-8f9354f1896f

src/utils/padsp.c

index aa0ec9ddf6b3562ae25b5f1d8a5fddcac19a533d..b4c5bb0bae1b858e1a09b5110c6b68eafd3b2085 100644 (file)
@@ -1800,6 +1800,16 @@ fail:
 static int dsp_ioctl(fd_info *i, unsigned long request, void*argp, int *_errno) {
     int ret = -1;
 
+    if (i->thread_fd == -1) {
+        /*
+         * We've encountered some fatal error and are just waiting
+         * for a close.
+         */
+        debug(DEBUG_LEVEL_NORMAL, __FILE__": got ioctl 0x%08lx in fatal error state\n", request);
+        *_errno = EIO;
+        return -1;
+    }
+
     switch (request) {
         case SNDCTL_DSP_SETFMT: {
             debug(DEBUG_LEVEL_NORMAL, __FILE__": SNDCTL_DSP_SETFMT: %i\n", *(int*) argp);