Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 5.6k
Fix illumox-x64 build with gcc and clang#129322
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
9abbcb472ba266acc3f32626a07ccd79548e0346a27fe19eb838c141344c6f79c5570e4c0bcddFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -225,7 +225,7 @@ handler_from_sigaction (struct sigaction *sa) | ||
| } | ||
| else | ||
| { | ||
| return sa->sa_handler; | ||
| return (VoidIntFn)sa->sa_handler; | ||
| } | ||
| } | ||
| @@ -838,7 +838,10 @@ static int32_t ForkAndExecProcessInternal( | ||
| struct sigaction sa_default; | ||
| struct sigaction sa_old; | ||
| memset(&sa_default, 0, sizeof(sa_default)); // On some architectures, sa_mask is a struct so assigning zero to it doesn't compile | ||
| #pragma clang diagnostic push | ||
| #pragma clang diagnostic ignored "-Wstrict-prototypes" | ||
| sa_default.sa_handler = SIG_DFL; | ||
am11 marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| #pragma clang diagnostic pop | ||
| for (int sig = 1; sig < NSIG; ++sig) | ||
| { | ||
| if (sig == SIGKILL || sig == SIGSTOP) | ||
| @@ -848,7 +851,12 @@ static int32_t ForkAndExecProcessInternal( | ||
| if (!sigaction(sig, NULL, &sa_old)) | ||
| { | ||
| void (*oldhandler)(int) = handler_from_sigaction (&sa_old); | ||
| if (oldhandler != SIG_IGN && oldhandler != SIG_DFL) | ||
| bool hasCustomHandler; | ||
| #pragma clang diagnostic push | ||
| #pragma clang diagnostic ignored "-Wstrict-prototypes" | ||
| hasCustomHandler = oldhandler != SIG_IGN && oldhandler != SIG_DFL; | ||
janvorli marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| #pragma clang diagnostic pop | ||
| if (hasCustomHandler) | ||
| { | ||
| // It has a custom handler, put the default handler back. | ||
| // We check first to preserve flags on default handlers. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -69,18 +69,28 @@ static bool IsSaSigInfo(struct sigaction* action) | ||
| static bool IsSigDfl(struct sigaction* action) | ||
| { | ||
| assert(action); | ||
| bool isDefault; | ||
| // macOS can return sigaction with SIG_DFL and SA_SIGINFO. | ||
| // SA_SIGINFO means we should use sa_sigaction, but here we want to check sa_handler. | ||
| // So we ignore SA_SIGINFO when sa_sigaction and sa_handler are at the same address. | ||
| return (&action->sa_handler == (void*)&action->sa_sigaction || !IsSaSigInfo(action)) && | ||
| action->sa_handler == SIG_DFL; | ||
| #pragma clang diagnostic push | ||
| #pragma clang diagnostic ignored "-Wstrict-prototypes" | ||
| isDefault = (&action->sa_handler == (void*)&action->sa_sigaction || !IsSaSigInfo(action)) && | ||
| action->sa_handler == SIG_DFL; | ||
| #pragma clang diagnostic pop | ||
| return isDefault; | ||
| } | ||
| static bool IsSigIgn(struct sigaction* action) | ||
| { | ||
| assert(action); | ||
| return (&action->sa_handler == (void*)&action->sa_sigaction || !IsSaSigInfo(action)) && | ||
| action->sa_handler == SIG_IGN; | ||
| bool isIgnored; | ||
| #pragma clang diagnostic push | ||
| #pragma clang diagnostic ignored "-Wstrict-prototypes" | ||
| isIgnored = (&action->sa_handler == (void*)&action->sa_sigaction || !IsSaSigInfo(action)) && | ||
| action->sa_handler == SIG_IGN; | ||
| #pragma clang diagnostic pop | ||
| return isIgnored; | ||
| } | ||
| bool TryConvertSignalCodeToPosixSignal(int signalCode, PosixSignal* posixSignal) | ||
| @@ -239,7 +249,7 @@ static void SignalHandler(int sig, siginfo_t* siginfo, void* context) | ||
| else | ||
| { | ||
| assert(origHandler->sa_handler); | ||
| origHandler->sa_handler(sig); | ||
| ((void (*)(int))origHandler->sa_handler)(sig); | ||
am11 marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.