Skip to content
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

Internal handlers for SIGINT, SIGTERM and SIGQUIT #253

Merged
merged 10 commits into from
May 1, 2023

Conversation

magicant
Copy link
Owner

No description provided.

@magicant magicant self-assigned this Apr 10, 2023
This refactoring commit adds the GrandState::set_internal_handler method
to reduce code duplication in TrapSet::enable_sigchld_handler and
TrapSet::enable_terminator_handlers.

SignalHandling is now Ord, so that we can use the max method to compute
the actual signal handling to use.

The new GrandState::internal_handler field will eventually replace the
internal_handler_enabled field, which will be removed in a future
commit.
yash-env/src/trap/state.rs Show resolved Hide resolved
yash-env/src/trap/state.rs Show resolved Hide resolved
yash-env/src/trap/state.rs Show resolved Hide resolved
yash-env/src/trap/state.rs Show resolved Hide resolved
yash-env/src/trap/state.rs Show resolved Hide resolved
This (mostly) refactoring commit implements the enter_subshell and
ignore functions in the GrandState structure. TrapSet::enter_subshell
now delegates to these new functions.

This commit also makes the trap set uninstall terminator handlers on
entering a subshell.
This field is unused now that we have GrandState::internal_handler.
@magicant magicant marked this pull request as ready for review April 30, 2023 14:04
@magicant magicant changed the title Internal handlers for signals other than SIGCHLD Internal handlers for SIGINT, SIGTERM and SIGQUIT Apr 30, 2023
@magicant magicant merged commit e16e755 into master May 1, 2023
@magicant magicant deleted the terminator_handler branch May 1, 2023 08:05
@magicant magicant mentioned this pull request May 7, 2023
26 tasks
@magicant magicant mentioned this pull request Jul 21, 2024
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant