summaryrefslogtreecommitdiff
path: root/audio
diff options
context:
space:
mode:
authormalc <av1474@comtv.ru>2010-08-06 13:09:41 +0400
committermalc <av1474@comtv.ru>2010-08-06 13:15:31 +0400
commit2a2556ad215d5c69d65e8740120014f29559edfd (patch)
tree8afd033520d61f05d80a3c70165af0cd595583ef /audio
parenta652de4e7506db4982a1928380c69d5fb2431001 (diff)
downloadqemu-2a2556ad215d5c69d65e8740120014f29559edfd.tar.gz
qemu-2a2556ad215d5c69d65e8740120014f29559edfd.tar.bz2
qemu-2a2556ad215d5c69d65e8740120014f29559edfd.zip
audio/sdl: be more anal about errors
Signed-off-by: malc <av1474@comtv.ru>
Diffstat (limited to 'audio')
-rw-r--r--audio/sdlaudio.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/audio/sdlaudio.c b/audio/sdlaudio.c
index c353016c1f..0f23fd372a 100644
--- a/audio/sdlaudio.c
+++ b/audio/sdlaudio.c
@@ -184,11 +184,19 @@ static int sdl_open (SDL_AudioSpec *req, SDL_AudioSpec *obt)
{
int status;
#ifndef _WIN32
+ int err;
sigset_t new, old;
/* Make sure potential threads created by SDL don't hog signals. */
- sigfillset (&new);
- pthread_sigmask (SIG_BLOCK, &new, &old);
+ err = sigfillset (&new);
+ if (err) {
+ dolog ("sdl_open: sigfillset failed: %s\n", strerror (errno));
+ }
+ err = pthread_sigmask (SIG_BLOCK, &new, &old);
+ if (err) {
+ dolog ("sdl_open: pthread_sigmask failed: %s\n", strerror (err));
+ return -1;
+ }
#endif
status = SDL_OpenAudio (req, obt);
@@ -197,7 +205,14 @@ static int sdl_open (SDL_AudioSpec *req, SDL_AudioSpec *obt)
}
#ifndef _WIN32
- pthread_sigmask (SIG_SETMASK, &old, NULL);
+ err = pthread_sigmask (SIG_SETMASK, &old, NULL);
+ if (err) {
+ dolog ("sdl_open: pthread_sigmask (restore) failed: %s\n",
+ strerror (errno));
+ /* We have failed to restore original signal mask, all bets are off,
+ so exit the process */
+ exit (EXIT_FAILURE);
+ }
#endif
return status;
}