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

Fix getDriver crash #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Fix getDriver crash #6

wants to merge 1 commit into from

Conversation

squalus
Copy link

@squalus squalus commented Dec 16, 2023

Properly handle a NULL return from udev_device_get_driver.

Change return type of getDriver to Maybe ByteString to account for a missing result.

Add getDriver to the monitor example.

Closes #5.


The comment on the udev_device_get_driver C function indicates it can return NULL. I observed this on my system.

https://github.com/systemd/systemd/blob/e6267e832bc8/src/libudev/libudev-device.c#L120

Returns: the driver name string, or #NULL if there is no driver attached.

Properly handle a NULL return from udev_device_get_driver.

Change return type of getDriver to Maybe ByteString to account for
a missing result.

Add getDriver to the monitor example.

Closes LeifW#5.
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.

getDriver causes SegFault
1 participant