SHA256
1
0
forked from pool/alsa-utils
alsa-utils/0005-aplay-Fix-uninterruptible-aplay.patch
Takashi Iwai fa525f71d0 Accepting request 316472 from home:tiwai:branches:multimedia:libs
- Backport upstream fixes for aplay signal handling and alsactl
  possible buffer overflow of readlink():
  0004-aplay-Fix-type-for-signal-flag.patch
  0005-aplay-Fix-uninterruptible-aplay.patch
  0006-alsactl-terminate-readlink-result-string.patch

OBS-URL: https://build.opensuse.org/request/show/316472
OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/alsa-utils?expand=0&rev=118
2015-07-13 15:41:56 +00:00

36 lines
1.0 KiB
Diff

From 46b60827568ca4aad15eeacbc9dcf8597986ca8e Mon Sep 17 00:00:00 2001
From: Takashi Iwai <tiwai@suse.de>
Date: Wed, 29 Apr 2015 18:01:58 +0200
Subject: [PATCH] aplay: Fix uninterruptible aplay
When aplay is invoked to play from stdin, it can't be terminated by
normal signals like SIGTERM or SIGINT. It's because our signal
handler tries to trap as much as possible while the stalling point is
not in the PCM loop but rather the file I/O.
For fixing this, leave our signal handler once when a signal is
received and snd_pcm_abort() is called. At the next hit, it shall be
handled normally.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
aplay/aplay.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/aplay/aplay.c b/aplay/aplay.c
index dfa1a0a95867..459f7dd6f667 100644
--- a/aplay/aplay.c
+++ b/aplay/aplay.c
@@ -399,7 +399,7 @@ static void signal_handler(int sig)
handle = NULL;
prg_exit(EXIT_FAILURE);
}
- signal(sig, signal_handler);
+ signal(sig, SIG_DFL);
}
/* call on SIGUSR1 signal. */
--
2.4.5