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

Update examples/listen_uevents.rs #6

Merged
merged 1 commit into from
Oct 27, 2024
Merged

Conversation

manio
Copy link
Contributor

@manio manio commented Oct 26, 2024

Slice was wrong leading to from_netlink_packet() panicking.

Slice was wrong leading to `from_netlink_packet()` panicking.
@lu-zero
Copy link
Collaborator

lu-zero commented Oct 27, 2024

How exactly is it wrong?

@manio
Copy link
Contributor Author

manio commented Oct 27, 2024

Like this:

thread 'tokio-runtime-worker' panicked at src/main.rs:135:60:
called `Result::unwrap()` on an `Err` value: action not found
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

line 135 is:

            let u = UEvent::from_netlink_packet(&buf[..n]).unwrap();

from your example.
I am running it on arm-unknown-linux-gnueabihf

@lu-zero
Copy link
Collaborator

lu-zero commented Oct 27, 2024

Sigh the example could be cleaned up further.

@lu-zero
Copy link
Collaborator

lu-zero commented Oct 27, 2024

Thank you for providing a fix

@lu-zero lu-zero merged commit 2b2b4ab into rust-italia:master Oct 27, 2024
3 checks passed
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.

2 participants