Bug 3042 - lnx_io.c contains conditional code that uses kernel headers in a broken way
Summary: lnx_io.c contains conditional code that uses kernel headers in a broken way
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Server/General (show other bugs)
Version: git
Hardware: x86 (IA32) Linux (All)
: high normal
Assignee: Xorg Project Team
QA Contact:
URL:
Whiteboard:
Keywords: janitor, patch
Depends on:
Blocks:
 
Reported: 2005-04-15 13:46 UTC by Mike A. Harris
Modified: 2006-07-08 11:11 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
Handle the kbd_repeat field name via autoconf (3.17 KB, patch)
2006-06-08 00:35 UTC, Tilman Sauerbeck
no flags Details | Splinter Review
Fixed patch (5.32 KB, patch)
2006-06-08 00:44 UTC, Tilman Sauerbeck
no flags Details | Splinter Review

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.