summaryrefslogtreecommitdiff
path: root/src/utils/padsp.c
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2007-01-04 14:20:53 +0000
committerPierre Ossman <ossman@cendio.se>2007-01-04 14:20:53 +0000
commit4c0a481f79715c0e783000c75e800d2401c11019 (patch)
tree2fbda8d399090c7595c2f4f10778e0a293e46f83 /src/utils/padsp.c
parentc992ed9c47854338106b38a1d093c4c1bf65e96d (diff)
Report IO error on ioctl() when we're in a fatal error state.
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1421 fefdeb5f-60dc-0310-8127-8f9354f1896f
Diffstat (limited to 'src/utils/padsp.c')
-rw-r--r--src/utils/padsp.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/utils/padsp.c b/src/utils/padsp.c
index aa0ec9ddf..b4c5bb0ba 100644
--- a/src/utils/padsp.c
+++ b/src/utils/padsp.c
@@ -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);