mirror of
https://github.com/kanjitalk755/macemu.git
synced 2025-08-07 20:25:23 +00:00
Merge pull request #256 from rakslice/ether_ignore_other_sigpipe_handler
Do not treat it as an error when ignoring SIGPIPE if there is already a handler installed
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user