mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-04 13:29:59 -05:00
core-util: introduce pa_disable_sigpipe()
This commit is contained in:
parent
ebce3185ef
commit
759a9d0cc5
4 changed files with 27 additions and 4 deletions
|
|
@ -2711,3 +2711,24 @@ char *pa_realpath(const char *path) {
|
|||
|
||||
return t;
|
||||
}
|
||||
|
||||
void pa_disable_sigpipe(void) {
|
||||
|
||||
#ifdef SIGPIPE
|
||||
struct sigaction sa;
|
||||
|
||||
pa_zero(sa);
|
||||
|
||||
if (sigaction(SIGPIPE, NULL, &sa) < 0) {
|
||||
pa_log("sigaction(): %s", pa_cstrerror(errno));
|
||||
return;
|
||||
}
|
||||
|
||||
sa.sa_handler = SIG_IGN;
|
||||
|
||||
if (sigaction(SIGPIPE, &sa, NULL) < 0) {
|
||||
pa_log("sigaction(): %s", pa_cstrerror(errno));
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue