mirror of
https://github.com/kanjitalk755/macemu.git
synced 2025-03-13 09:32:54 +00:00
Do not treat it as an error when ignoring SIGPIPE if there is already a SIGPIPE handler installed
This commit is contained in:
parent
63e28afb8e
commit
01dc76b0f4
@ -326,11 +326,14 @@ bool ether_init(void)
|
||||
// Don't raise SIGPIPE, let errno be set to EPIPE
|
||||
struct sigaction sigpipe_sa;
|
||||
if (sigaction(SIGPIPE, NULL, &sigpipe_sa) == 0) {
|
||||
assert(sigpipe_sa.sa_handler == SIG_DFL || sigpipe_sa.sa_handler == SIG_IGN);
|
||||
sigfillset(&sigpipe_sa.sa_mask);
|
||||
sigpipe_sa.sa_flags = 0;
|
||||
sigpipe_sa.sa_handler = SIG_IGN;
|
||||
sigaction(SIGPIPE, &sigpipe_sa, NULL);
|
||||
if (sigpipe_sa.sa_handler == SIG_DFL || sigpipe_sa.sa_handler == SIG_IGN) {
|
||||
sigfillset(&sigpipe_sa.sa_mask);
|
||||
sigpipe_sa.sa_flags = 0;
|
||||
sigpipe_sa.sa_handler = SIG_IGN;
|
||||
sigaction(SIGPIPE, &sigpipe_sa, NULL);
|
||||
}
|
||||
// If something else in the process has installed a SIGPIPE handler (SDL kmsdrm?),
|
||||
// and wants to eat our unwanted signals instead, that's fine too.
|
||||
}
|
||||
|
||||
#ifdef HAVE_SLIRP
|
||||
|
Loading…
x
Reference in New Issue
Block a user