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.
The Python code is already ready to deal with
uinput_get_sysname()
throwing OSError in case the ioctlUI_GET_SYSNAME
is not available, but it turns out that the C object code refuses to link if the macroUI_GET_SYSNAME
was not defined at build time, because the compiler assumes thatUI_GET_SYSNAME
is a symbol that will be defined later at link time. (Issue #178)Add an
#ifdef
guard around the code that relies onUI_GET_SYSNAME
so that no reference to any hypothetical symbolUI_GET_SYSNAME
remains in the object code if theUI_GET_SYSNAME
macro was undefined at build time. This will causeuinput_get_sysname()
to raise OSError if theUI_GET_SYSNAME
was not defined at build time.