Always include afsconfig.h
authorSimon Wilkinson <sxw@inf.ed.ac.uk>
Thu, 6 May 2010 13:55:59 +0000 (14:55 +0100)
committerDerrick Brashear <shadow@dementia.org>
Thu, 6 May 2010 18:52:08 +0000 (11:52 -0700)
Our coding standards say that OpenAFS source files should always have
 #include <afsconfig.h>
 #include <afs/param.h>
at the start of the file. Including just param.h, or having these
includes in a different order can produce unexpected effects, because
param.h includes sysnames.h, which in turn includes stds.h, which may
rely upon having the results of configure tests available.

Fix the obvious places in the Unix build which get this wrong.

Change-Id: I081f04dab30a6bbb49fe71d3ac2d7c11e231e2f5
Reviewed-on: http://gerrit.openafs.org/1912
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

14 files changed:
src/JAVA/libjafs/ACL.c
src/JAVA/libjafs/FileOutputStream.c
src/JAVA/libjafs/UserToken.c
src/butc/afsxbsa.c
src/rxkad/fc_test.c
src/rxstat/rxstat.c
src/tests/afscp.c
src/tests/afscp_callback.c
src/tests/afsdump_extract.c
src/tests/afsdump_scan.c
src/tests/dumptool.c
src/tests/write-closed2.c
src/util/fstab.c
src/vol/namei_map.c

index e60166e..204b743 100644 (file)
@@ -19,6 +19,7 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#include <afsconfig.h>
 #include <afs/param.h>
 #include <afs/stds.h>
 #include <errno.h>
index e728da1..76aceda 100644 (file)
@@ -19,6 +19,7 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#include <afsconfig.h>
 #include <afs/param.h>
 #include <errno.h>
 
index 1fa5b48..0512501 100644 (file)
@@ -19,6 +19,7 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#include <afsconfig.h>
 #include <afs/param.h>
 
 #include "Internal.h"
index 1add508..77920f4 100644 (file)
@@ -9,7 +9,9 @@
 
 #ifdef xbsa
 
+#include <afsconfig.h>
 #include <afs/param.h>
+
 #include <sys/types.h>
 #include <afs/stds.h>
 #include <stdio.h>
index 28cc589..b80e080 100644 (file)
@@ -31,6 +31,7 @@
  * SUCH DAMAGE.
  */
 
+#include <afsconfig.h>
 #include <afs/param.h>
 #include "rxkad.h"
 #include <rx/rx.h>
index bfb7898..4d3801f 100644 (file)
@@ -7,8 +7,8 @@
  * directory or online at http://www.openafs.org/dl/license10.html
  */
 
-#include <afs/param.h>
 #include <afsconfig.h>
+#include <afs/param.h>
 
 
 #include <afs/stds.h>
index 717e705..da858d5 100644 (file)
@@ -1,3 +1,6 @@
+#include <afsconfig.h>
+#include <afs/param.h>
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -11,7 +14,6 @@
 #include <sys/stat.h>
 #include <netdb.h>
 
-#include <afs/param.h>
 #include <afs/afsint.h>
 #define FSINT_COMMON_XG 1
 #include <afs/afscbint.h>
index 4a9afa0..e590a26 100644 (file)
@@ -1,4 +1,6 @@
+#include <afsconfig.h>
 #include <afs/param.h>
+
 #include <afs/afscbint.h>      /*Callback interface defs */
 #include <afs/afsutil.h>
 #include <afs/afsutil_prototypes.h>
index 9558775..b1ecbb9 100644 (file)
@@ -28,6 +28,9 @@
 
 /* afsdump_extract.c - Extract files from an AFS dump */
 
+#include <afsconfig.h>
+#include <afs/param.h>
+
 #include <sys/fcntl.h>
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -35,7 +38,6 @@
 #include <stdarg.h>
 #include <string.h>
 
-#include <afs/param.h>
 #include <afs/com_err.h>
 #include "dumpscan.h"
 #include "dumpscan_errs.h"
index 0e42211..98f1a49 100644 (file)
 
 /* afsdump_scan.c - General-purpose dump scanner */
 
+#include <afsconfig.h>
+#include <afs/param.h>
+
 #include <sys/fcntl.h>
 #include <stdlib.h>
 #include <stdarg.h>
 #include <string.h>
 
-#include <afs/param.h>
 #include <afs/com_err.h>
 #include <afs/pterror.h>
 #include <afs/vlserver.h>
index decf80b..fee670e 100644 (file)
@@ -61,6 +61,9 @@
  * so directories will appear first in the VNODE section.
  */
 
+#include <afsconfig.h>
+#include <afs/param.h>
+
 #include <stdio.h>
 #include <sys/types.h>
 #include <sys/param.h>
@@ -74,7 +77,6 @@
 #include <fcntl.h>
 
 #include <lock.h>
-#include <afs/param.h>
 #include <afs/afsint.h>
 #include <afs/nfs.h>
 #include <afs/acl.h>
index 22e147f..a812ff3 100644 (file)
@@ -31,6 +31,9 @@
  * SUCH DAMAGE.
  */
 
+#include <afsconfig.h>
+#include <afs/param.h>
+
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
@@ -53,7 +56,6 @@
 
 #include <err.h>
 #include <netinet/in.h>
-#include <afs/param.h>
 #include <afs/stds.h>
 #include <afs/vice.h>
 #include <afs/venus.h>
index 50d0740..cb289e3 100644 (file)
@@ -27,6 +27,7 @@
  * SUCH DAMAGE.
  */
 
+#include <afsconfig.h>
 #include <afs/param.h>
 
 #if defined(AFS_DARWIN_ENV)
index 8b24c6f..e93b7f4 100644 (file)
@@ -1,8 +1,10 @@
+#include <afsconfig.h>
+#include <afs/param.h>
+
 #include <sys/types.h>
 #include <inttypes.h>
 #include <stdio.h>
 #include <stdlib.h>
-#include <afs/param.h>
 #include <afs/afsutil.h>
 
 int main(int argc, char **argv) {