UKERNEL: avoid double include of roken.h 30/15130/4
authorCheyenne Wills <cwills@sinenomine.net>
Mon, 19 Sep 2022 22:25:13 +0000 (16:25 -0600)
committerBenjamin Kaduk <kaduk@mit.edu>
Fri, 16 Dec 2022 15:20:27 +0000 (10:20 -0500)
commitcc0ffc56e85eec4133bcc5e745efa28f5d3c53a7
tree49104843221fb4d493b17545cc8414d4fad0e58c
parent1fbbcbee0183aa7855c0e5d9d38aa89af75902db
UKERNEL: avoid double include of roken.h

Commit 'afs: Replace strcpy &co by safer alternatives' (419f0cd7aa75719)
added an include for roken.h into UKERNEL/afsincludes.h.  Neither
UKERNEL/afsincludes.h or roken.h has a guard against a double include,
which can result in a build failure on older kernels (discovered on a
2.6.18 build):

 In file included from ~/openafs/src/afs/UKERNEL/afsincludes.h:30,
          from ~/openafs/src/afs/UKERNEL/afs_usrops.h:15,
          from ~/openafs/src/afs/UKERNEL/afs_usrops.c:24:
 include/roken.h:89: error: redefinition of typedef 'rk_socket_t'
 include/roken.h:89: error: previous declaration of 'rk_socket_t' was here
 In file included from ~/openafs/src/afs/UKERNEL/afsincludes.h:30,
          from ../afs/afsincludes.h:16,
          from ../afs/afs_bypasscache.h:68,
          from ~/openafs/src/afs/UKERNEL/afs_usrops.c:30:

Since roken.h is from an external source, we cannot update it to add
the necessary check.

Update UKERNEL/afsincludes.h to add a check to see if it has already
been included.

auth/ktc.c has a required include for roken.h, but it also can pull in
UKERNEL/afsincludes.h as well.  This can result in a double include for
roken.h.

Update auth/ktc.c to only include roken.h if not building UKERNEL.

Change-Id: I192443006f6c2257de57b35a6580b1df358c011c
Reviewed-on: https://gerrit.openafs.org/15130
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
src/afs/UKERNEL/afsincludes.h
src/auth/ktc.c