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

Bugfix posix signals #5960

Merged
merged 2 commits into from
Mar 20, 2024
Merged

Bugfix posix signals #5960

merged 2 commits into from
Mar 20, 2024

Conversation

systec-awe
Copy link
Contributor

Since there is no separate error handling the SIGUSR2 signal is registered to get the write return code after exiting the program.

Additionally, the num_watchers variable is made const since it depends on a fixed array size and should not be modifyable after creation. Optimization can also benefit from const value.

Fixes #5958

SIGUSR1 was registered twice.

Signed-off-by: Andre Werner <andre.werner@systec-electronic.com>
As this variable is only written once it may benefit from constness
during optimizations. As well, the size should not be accidentally
changed since the array lays at the stack and has a fixed size.

Signed-off-by: Andre Werner <andre.werner@systec-electronic.com>
Copy link
Member

@orestisfl orestisfl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@orestisfl orestisfl enabled auto-merge (squash) March 20, 2024 08:59
@orestisfl orestisfl disabled auto-merge March 20, 2024 08:59
@orestisfl orestisfl enabled auto-merge (squash) March 20, 2024 08:59
@orestisfl orestisfl merged commit 47cab33 into i3:next Mar 20, 2024
3 checks passed
@systec-awe systec-awe deleted the bugfix_posix_signals branch March 20, 2024 13:02
desmana pushed a commit to desmana/i3 that referenced this pull request Apr 3, 2024
Since there is no separate error handling the `SIGUSR2` signal is
registered to get the write return code after exiting the program.

Fixes i3#5958

---------

Signed-off-by: Andre Werner <andre.werner@systec-electronic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Copy'n'Paste Error for SIGUSR1 and SIGUSR2 signal handler
2 participants