]> git.michaelhowe.org Git - packages/o/openafs.git/commit
Fix UCONTEXT detection on ppc_linux26 via include order
authorRuss Allbery <rra@stanford.edu>
Tue, 20 Apr 2010 05:01:27 +0000 (22:01 -0700)
committerRuss Allbery <rra@debian.org>
Wed, 21 Apr 2010 00:52:23 +0000 (17:52 -0700)
commit063fe7145cedddbafcd12097cfd93a2389b5ac12
treef33da01f1b8ade8500b8d15fb2a062a7673e4715
parent3052b517ef11717c28cbbe724a0d3a30e34d97cc
Fix UCONTEXT detection on ppc_linux26 via include order

param.linux26.h defines USE_UCONTEXT for all Linux platforms for
glibc 2.4 and higher, but it does this by testing __GLIBC__ and
__GLIBC_MINOR__.  These are defined by features.h, which is included
by any system header.  At least one system header must be included
before those are defined.  lwp/process.c was including <afsconfig.h>
and <afs/param.h> before any other headers, leading to those macros
being undefined.  Most of the Linux architectures either have their
own implementation or were explicitly defining USE_UCONTEXT in the
per-architecture param file, but ppc_linux26 was relying on the
default.

Fix this by reordering the includes to include the various system
headers before <afs/param.h> and add a comment explaining why.

This previously worked in earlier versions because the old
param.ppc_linux26.h file included <afs/afs_sysnames.h>, which
included "stds.h", which included a system header prior to the check
for ucontext.  The new generic param file reverses that order.

Change-Id: I214e54f684afdef07e6e2dec5b6e6e4d255ab4ec
src/lwp/process.c