Bug 3042

Summary: lnx_io.c contains conditional code that uses kernel headers in a broken way
Product: xorg Reporter: Mike A. Harris <mharris>
Component: Server/GeneralAssignee: Xorg Project Team <xorg-team>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: high CC: tilman
Version: gitKeywords: janitor, patch
Hardware: x86 (IA32)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
Handle the kbd_repeat field name via autoconf
none
Fixed patch none

Description Mike A. Harris 2005-04-15 13:46:44 UTC
lnx_io.c uses the linux/version.h to attempt to autodetect which
version of the kernel headers are installed in order to determine
wether a struct member is named "rate" or "period" and set
a macro to remove the difference essentially.

The linux/version.h header however is a glibc header, and the kernel
version present in it is not necessarily of the versioning that
applications might think it is.

Example:
    https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=155025
    https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=117020

The reliance on the kernel header should probably be removed, and some
other check implemented instead which is more neutral.  This is
a preventative maintenance for now, but it will be a problem in 
several months likely.
Comment 1 Alan Coopersmith 2006-06-07 17:50:56 UTC
Shouldn't this be easily handlable in an autoconf check now?
Comment 2 Tilman Sauerbeck 2006-06-08 00:35:46 UTC
Created attachment 5848 [details] [review]
Handle the kbd_repeat field name via autoconf

This patch adds some autoconf magic to test whether the field name is called
"period". If it's not, it's assumed that it's "rate" instead.

Once there are more than these two alternatives, the check needs to be
extended, but I guess it's good enough for now.

Tested on Linux 2.6.16.
Comment 3 Tilman Sauerbeck 2006-06-08 00:44:26 UTC
Created attachment 5849 [details] [review]
Fixed patch

Forgot to patch lnx_kbd.c as well.
Comment 4 Tilman Sauerbeck 2006-07-08 11:11:18 UTC
Fixed in 39b2f7b2182aedb1ab45415efb4c263012ace512.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.