diff --git a/src/audio/alsa/SDL_alsa_audio.c b/src/audio/alsa/SDL_alsa_audio.c index 4854fb1151529f7003d34f0add30a488f7ba2e0e..98f89ed728b317eb7c9bb3166cc66a8edf1f18cd 100644 --- a/src/audio/alsa/SDL_alsa_audio.c +++ b/src/audio/alsa/SDL_alsa_audio.c @@ -230,7 +230,7 @@ ALSA_WaitDevice(_THIS) */ /* Check every 10 loops */ if (this->hidden->parent && (((++cnt) % 10) == 0)) { - if (kill(this->hidden->parent, 0) < 0) { + if (kill(this->hidden->parent, 0) < 0 && errno == ESRCH) { this->enabled = 0; } } diff --git a/src/audio/arts/SDL_artsaudio.c b/src/audio/arts/SDL_artsaudio.c index 64b1c69d4594aa0d1d766df1f64235a90ee0d1de..b2b79bc6f8bb71c58ace44c66d0b8681012c7387 100644 --- a/src/audio/arts/SDL_artsaudio.c +++ b/src/audio/arts/SDL_artsaudio.c @@ -27,6 +27,7 @@ #include <signal.h> #endif #include <unistd.h> +#include <errno.h> #include "SDL_timer.h" #include "SDL_audio.h" @@ -149,7 +150,7 @@ ARTS_WaitDevice(_THIS) */ /* Check every 10 loops */ if (this->hidden->parent && (((++cnt) % 10) == 0)) { - if (kill(this->hidden->parent, 0) < 0) { + if (kill(this->hidden->parent, 0) < 0 && errno == ESRCH) { this->enabled = 0; } } diff --git a/src/audio/dma/SDL_dmaaudio.c b/src/audio/dma/SDL_dmaaudio.c index 62a72dc26f2d5509d52f85dda5110c3705dd76a2..6ab6c1a287cf51c14e739bfd03fabd3c01da0037 100644 --- a/src/audio/dma/SDL_dmaaudio.c +++ b/src/audio/dma/SDL_dmaaudio.c @@ -417,7 +417,7 @@ DMA_WaitDevice(_THIS) that use a different process id for each thread. */ if (parent && (((++cnt) % 10) == 0)) { /* Check every 10 loops */ - if (kill(parent, 0) < 0) { + if (kill(parent, 0) < 0 && errno == ESRCH) { this->enabled = 0; } } diff --git a/src/audio/esd/SDL_esdaudio.c b/src/audio/esd/SDL_esdaudio.c index 0a9078ee2e91b011187c16ae02b1f1d17bba8eb1..515cd61bd38e9130610e7ac50e9f19f45587d04e 100644 --- a/src/audio/esd/SDL_esdaudio.c +++ b/src/audio/esd/SDL_esdaudio.c @@ -128,7 +128,7 @@ ESD_WaitDevice(_THIS) */ /* Check every 10 loops */ if (this->hidden->parent && (((++cnt) % 10) == 0)) { - if (kill(this->hidden->parent, 0) < 0) { + if (kill(this->hidden->parent, 0) < 0 && errno == ESRCH) { this->enabled = 0; } } diff --git a/src/audio/pulseaudio/SDL_pulseaudio.c b/src/audio/pulseaudio/SDL_pulseaudio.c index 0521331eebab31774a4f397407a6a606b1bbd577..445ef048629ddde671c1ad4a2e3bd3fd79206d06 100644 --- a/src/audio/pulseaudio/SDL_pulseaudio.c +++ b/src/audio/pulseaudio/SDL_pulseaudio.c @@ -165,7 +165,7 @@ PULSEAUDIO_WaitDevice(_THIS) */ /* Check every 10 loops */ if (this->hidden->parent && (((++cnt) % 10) == 0)) { - if (kill(this->hidden->parent, 0) < 0) { + if (kill(this->hidden->parent, 0) < 0 && errno == ESRCH) { this->enabled = 0; } }