mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-11-09 12:33:17 +01:00
gmain: Use alternate signal stack if the application provides one
Some applications, toolkits or languages may define an alternative stack to use for traces. This is for example the case of go. So, in case an application defines an alternate signal stack, GLib should use that instead of the default one to receive signals otherwise it may break the application expectations and write where it's not allowed to.
This commit is contained in:
@@ -5670,6 +5670,9 @@ ref_unix_signal_handler_unlocked (int signum)
|
||||
action.sa_flags = SA_RESTART | SA_NOCLDSTOP;
|
||||
#else
|
||||
action.sa_flags = SA_NOCLDSTOP;
|
||||
#endif
|
||||
#ifdef SA_ONSTACK
|
||||
action.sa_flags |= SA_ONSTACK;
|
||||
#endif
|
||||
sigaction (signum, &action, NULL);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user