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

Add #ifdef guards around UI_GET_SYSNAME #218

Merged
merged 1 commit into from
Apr 28, 2024

Conversation

KarsMulder
Copy link
Contributor

The Python code is already ready to deal with uinput_get_sysname() throwing OSError in case the ioctl UI_GET_SYSNAME is not available, but it turns out that the C object code refuses to link if the macro UI_GET_SYSNAME was not defined at build time, because the compiler assumes that UI_GET_SYSNAME is a symbol that will be defined later at link time. (Issue #178)

Add an #ifdef guard around the code that relies on UI_GET_SYSNAME so that no reference to any hypothetical symbol UI_GET_SYSNAME remains in the object code if the UI_GET_SYSNAME macro was undefined at build time. This will cause uinput_get_sysname() to raise OSError if the UI_GET_SYSNAME was not defined at build time.

If the C code is built with a kernel header that does not provide
UI_GET_SYSNAME, then ui_get_sysname() will always raise OSError.
(Unless incorrect arguments are provided to the function, in which
case the function still behaves as it otherwise would.)
@sezanzeb sezanzeb merged commit cb41241 into gvalkov:main Apr 28, 2024
6 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