8000 fix: refined swhks ipc.rs for hash calculation and finding buffer byte by nots1dd · Pull Request #306 · waycrate/swhkd · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix: refined swhks ipc.rs for hash calculation and finding buffer byte #306

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

Merged
merged 4 commits into from
Apr 3, 2025

Conversation

nots1dd
Copy link
Contributor
@nots1dd nots1dd commented Mar 26, 2025

Summary of changes:

  1. Calculate hash function now borrows the string instead of taking
    ownership
  2. Used match to check for buffer byte instead of if statement
  3. Added more debug logging and error handling

In swhkd/src/daemon.rs:

  1. Replaced map_for with is_some_and as it is more efficient in this
    case (simple bool ops)

This PR was tested with:

make test

Note:

I tried to modify uinput.rs to fix the rfkill issue but the logic did not really work so I had to fallback to the latest commit on swhkd (kindly ignore it)

I did not create any new tests as I just modified functional logic only.

nots1dd added 4 commits March 25, 2025 12:11
This commit attempts at fixing the major issue of rfkill not being
properly turned off while creating the swhkd virtual device.

Changes made:

1. Added RfkillEvent struct that stores the rfkill details and status
required with documentation
2. Added two new macros with `ioctl_readwrite` to ensure that we can
query the rfkill status and modify properly
3. New function `unblock_rfkill` that unblocks all soft blocks for any
device
4. Called `unblock_rfkill` function in `create_uinput_switches_device`
that ensures that rfkill is NOT blocked and complies with rfkill-input
being disabled

This should ensure that rfkill does not react when virtual device is
being created.
1. Calculate hash function now borrows the string instead of taking
ownership
2. Used match to check for buffer byte instead of if statement
3. Added more debug logging and error handling
Remove updated logic for uinput.rs as it does not work
replaced `map_for` with `is_some_and` as it is more efficient in this
case (simple bool ops)
@newtoallofthis123
Copy link
Collaborator

Looks good to me and I've tested it on my local machine
Waiting for your approval @Shinyzenith

@Shinyzenith
Copy link
Member

Looks good. I haven't tested so I'm relying on your findings. @newtoallofthis123 Go ahead with merge.

@Shinyzenith Shinyzenith merged commit 8f458aa into waycrate:main Apr 3, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already 5A34 have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0