rx: Reorganise includes
authorSimon Wilkinson <sxw@your-file-system.com>
Fri, 1 Oct 2010 08:36:06 +0000 (09:36 +0100)
committerJeffrey Altman <jaltman@openafs.org>
Sat, 6 Nov 2010 19:36:30 +0000 (12:36 -0700)
RX files were including the same header set in three different places,
once for user-land builds, once for kernel builds and once for ukernel.
The duplication was a bit pointless, and really frustrating when adding
new headers. So, reorganise the includes so that we only list headers
that are used in all three builds in one location.

Also take the opportunity to indent the #ifdefs so that it is clear
what is going on, and to remove some more of AFS_OSF_ENV and
AFS_AUX_ENV from kernel builds.

Change-Id: Ic2b5d39de4dd406bbc0acaa29fc876ac882ccf10
Reviewed-on: http://gerrit.openafs.org/3160
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

18 files changed:
src/rx/rx.c
src/rx/rx.h
src/rx/rx_clock.c
src/rx/rx_event.c
src/rx/rx_getaddr.c
src/rx/rx_globals.c
src/rx/rx_lwp.c
src/rx/rx_misc.c
src/rx/rx_multi.c
src/rx/rx_null.c
src/rx/rx_packet.c
src/rx/rx_pthread.c
src/rx/rx_rdwr.c
src/rx/rx_trace.c
src/rx/rx_user.c
src/rx/rx_xmit_nt.c
src/rx/xdr.c
src/rx/xdr_rx.c

index 5a189a2..f8a5496 100644 (file)
 /* RX:  Extended Remote Procedure Call */
 
 #include <afsconfig.h>
-#ifdef KERNEL
 #include "afs/param.h"
-#else
-#include <afs/param.h>
-#endif
-
 
 #ifdef KERNEL
-#include "afs/sysincludes.h"
-#include "afsincludes.h"
-#ifndef UKERNEL
-#include "h/types.h"
-#include "h/time.h"
-#include "h/stat.h"
-#ifdef AFS_OSF_ENV
-#include <net/net_globals.h>
-#endif /* AFS_OSF_ENV */
-#ifdef AFS_LINUX20_ENV
-#include "h/socket.h"
-#endif
-#include "netinet/in.h"
-#ifdef AFS_SUN57_ENV
-#include "inet/common.h"
-#include "inet/ip.h"
-#include "inet/ip_ire.h"
-#endif
-#include "afs/afs_args.h"
-#include "afs/afs_osi.h"
-#ifdef RX_KERNEL_TRACE
-#include "rx_kcommon.h"
-#endif
-#if    (defined(AFS_AUX_ENV) || defined(AFS_AIX_ENV))
-#include "h/systm.h"
-#endif
-#ifdef RXDEBUG
-#undef RXDEBUG                 /* turn off debugging */
-#endif /* RXDEBUG */
-#if defined(AFS_SGI_ENV)
-#include "sys/debug.h"
-#endif
-#include "afsint.h"
-#ifdef AFS_OSF_ENV
-#undef kmem_alloc
-#undef kmem_free
-#undef mem_alloc
-#undef mem_free
-#endif /* AFS_OSF_ENV */
-#else /* !UKERNEL */
-#include "afs/sysincludes.h"
-#include "afsincludes.h"
-#endif /* !UKERNEL */
-#include "afs/lock.h"
-#include "rx_kmutex.h"
-#include "rx_kernel.h"
-#include "rx_clock.h"
-#include "rx_queue.h"
-#include "rx.h"
-#include "rx_globals.h"
-#include "rx_trace.h"
-#include "rx_atomic.h"
-#include "rx_internal.h"
-#include "rx_stats.h"
-#define        AFSOP_STOP_RXCALLBACK   210     /* Stop CALLBACK process */
-#define        AFSOP_STOP_AFS          211     /* Stop AFS process */
-#define        AFSOP_STOP_BKG          212     /* Stop BKG process */
-#include "afsint.h"
+# include "afs/sysincludes.h"
+# include "afsincludes.h"
+# ifndef UKERNEL
+#  include "h/types.h"
+#  include "h/time.h"
+#  include "h/stat.h"
+#  ifdef AFS_LINUX20_ENV
+#   include "h/socket.h"
+#  endif
+#  include "netinet/in.h"
+#  ifdef AFS_SUN57_ENV
+#   include "inet/common.h"
+#   include "inet/ip.h"
+#   include "inet/ip_ire.h"
+#  endif
+#  include "afs/afs_args.h"
+#  include "afs/afs_osi.h"
+#  ifdef RX_KERNEL_TRACE
+#   include "rx_kcommon.h"
+#  endif
+#  if  defined(AFS_AIX_ENV)
+#   include "h/systm.h"
+#  endif
+#  ifdef RXDEBUG
+#   undef RXDEBUG                      /* turn off debugging */
+#  endif /* RXDEBUG */
+#  if defined(AFS_SGI_ENV)
+#   include "sys/debug.h"
+#  endif
+# else /* !UKERNEL */
+#  include "afs/sysincludes.h"
+#  include "afsincludes.h"
+# endif /* !UKERNEL */
+# include "afs/lock.h"
+# include "rx_kmutex.h"
+# include "rx_kernel.h"
+# define       AFSOP_STOP_RXCALLBACK   210     /* Stop CALLBACK process */
+# define       AFSOP_STOP_AFS          211     /* Stop AFS process */
+# define       AFSOP_STOP_BKG          212     /* Stop BKG process */
 extern afs_int32 afs_termState;
-#ifdef AFS_AIX41_ENV
-#include "sys/lockl.h"
-#include "sys/lock_def.h"
-#endif /* AFS_AIX41_ENV */
+# ifdef AFS_AIX41_ENV
+#  include "sys/lockl.h"
+#  include "sys/lock_def.h"
+# endif /* AFS_AIX41_ENV */
 # include "afs/rxgen_consts.h"
 #else /* KERNEL */
 # include <sys/types.h>
@@ -90,31 +66,33 @@ extern afs_int32 afs_termState;
 # ifdef HAVE_STDINT_H
 #  include <stdint.h>
 # endif
-#ifdef AFS_NT40_ENV
-# include <stdlib.h>
-# include <fcntl.h>
-# include <afs/afsutil.h>
-# include <WINNT\afsreg.h>
-#else
-# include <sys/socket.h>
-# include <sys/file.h>
-# include <netdb.h>
-# include <sys/stat.h>
-# include <netinet/in.h>
-# include <sys/time.h>
-#endif
-# include "rx.h"
+# ifdef AFS_NT40_ENV
+#  include <stdlib.h>
+#  include <fcntl.h>
+#  include <afs/afsutil.h>
+#  include <WINNT\afsreg.h>
+# else
+#  include <sys/socket.h>
+#  include <sys/file.h>
+#  include <netdb.h>
+#  include <sys/stat.h>
+#  include <netinet/in.h>
+#  include <sys/time.h>
+# endif
 # include "rx_user.h"
-# include "rx_clock.h"
-# include "rx_queue.h"
-# include "rx_atomic.h"
-# include "rx_globals.h"
-# include "rx_trace.h"
-# include "rx_internal.h"
-# include "rx_stats.h"
-# include <afs/rxgen_consts.h>
 #endif /* KERNEL */
 
+#include "rx.h"
+#include "rx_clock.h"
+#include "rx_queue.h"
+#include "rx_atomic.h"
+#include "rx_globals.h"
+#include "rx_trace.h"
+#include "rx_internal.h"
+#include "rx_stats.h"
+
+#include <afs/rxgen_consts.h>
+
 #ifndef KERNEL
 #ifdef AFS_PTHREAD_ENV
 #ifndef AFS_NT40_ENV
index 2c05d30..deb50fb 100644 (file)
 #ifdef KERNEL
 #include "rx_kmutex.h"
 #include "rx_kernel.h"
-#include "rx_clock.h"
-#include "rx_event.h"
-#include "rx_queue.h"
-#include "rx_packet.h"
-#include "rx_misc.h"
-#include "rx_multi.h"
 #if defined (AFS_OBSD_ENV) && !defined (MLEN)
 #include "sys/mbuf.h"
 #endif
 #include <ws2tcpip.h>
 #endif
 # include "rx_user.h"
-# include "rx_clock.h"
-# include "rx_event.h"
-# include "rx_packet.h"
-# include "rx_misc.h"
-# include "rx_null.h"
-# include "rx_multi.h"
 #ifndef AFS_NT40_ENV
 # include <netinet/in.h>
 # include <sys/socket.h>
 #endif
 #endif /* KERNEL */
 
+#include "rx_clock.h"
+#include "rx_event.h"
+#include "rx_packet.h"
+#include "rx_misc.h"
+#include "rx_null.h"
+#include "rx_multi.h"
 
 /* Configurable parameters */
 #define        RX_IDLE_DEAD_TIME       60      /* default idle dead time */
index d2ce7e9..38e726b 100644 (file)
 /* See rx_clock.h for calling conventions */
 
 #include <afsconfig.h>
-#ifdef KERNEL
 #include "afs/param.h"
-#else
-#include <afs/param.h>
-#endif
 
 #ifdef AFS_SUN59_ENV
 #include <sys/time_impl.h>
 #endif
 
-
 #ifdef KERNEL
-#ifndef UKERNEL
-#include "rx/rx_clock.h"
-#include "h/types.h"
-#include "h/time.h"
-#else /* !UKERNEL */
-#include "afs/sysincludes.h"
-#include "afsincludes.h"
-#include "rx/rx.h"
-#include "rx/rx_clock.h"
-#endif /* !UKERNEL */
+# ifndef UKERNEL
+#  include "h/types.h"
+#  include "h/time.h"
+# else /* !UKERNEL */
+#  include "afs/sysincludes.h"
+#  include "afsincludes.h"
+# endif /* !UKERNEL */
 #else /* KERNEL */
-#include <sys/time.h>
-#ifdef HAVE_SIGNAL_H
-#include <signal.h>
+# include <sys/time.h>
+# ifdef HAVE_SIGNAL_H
+#  include <signal.h>
+# endif
+# include <stdio.h>
+# include <errno.h>
+# include <stdlib.h>
 #endif
-#include <stdio.h>
-#include <errno.h>
-#include <stdlib.h>
+
 #include "rx.h"
 #include "rx_clock.h"
-#endif
 
 #if !defined(AFS_USE_GETTIMEOFDAY)
 /*use this package only if gettimeofday is much much costlier than getitime */
index 04f5a18..0d92584 100644 (file)
@@ -8,65 +8,51 @@
  */
 
 #include <afsconfig.h>
-#ifdef KERNEL
 #include "afs/param.h"
-#else
-#include <afs/param.h>
-#endif
 
 #ifdef AFS_SUN59_ENV
-#include <sys/time_impl.h>
+# include <sys/time_impl.h>
 #endif
 
-
 #ifdef KERNEL
-#ifndef UKERNEL
-#include "afs/afs_osi.h"
-#else /* !UKERNEL */
-#include "afs/sysincludes.h"
-#include "afsincludes.h"
-#endif /* !UKERNEL */
-#include "rx/rx_clock.h"
-#include "rx/rx_queue.h"
-#include "rx/rx_event.h"
-#include "rx/rx_kernel.h"
-#include "rx_kmutex.h"
-#ifdef RX_ENABLE_LOCKS
-#include "rx/rx.h"
-#endif /* RX_ENABLE_LOCKS */
-#include "rx/rx_globals.h"
-#if defined(AFS_SGI_ENV)
-#include "sys/debug.h"
+# ifndef UKERNEL
+#  include "afs/afs_osi.h"
+# else /* !UKERNEL */
+#  include "afs/sysincludes.h"
+#  include "afsincludes.h"
+# endif /* !UKERNEL */
+# include "rx_kernel.h"
+# include "rx_kmutex.h"
+# if defined(AFS_SGI_ENV)
+#  include "sys/debug.h"
 /* These are necessary to get curproc (used by GLOCK asserts) to work. */
-#include "h/proc.h"
-#if !defined(AFS_SGI64_ENV) && !defined(UKERNEL)
-#include "h/user.h"
-#endif
+#  include "h/proc.h"
+#  if !defined(AFS_SGI64_ENV) && !defined(UKERNEL)
+#   include "h/user.h"
+#  endif
 extern void *osi_Alloc();
-#endif
-#if defined(AFS_OBSD_ENV)
-#include "h/proc.h"
-#endif
+# endif
+# if defined(AFS_OBSD_ENV)
+#  include "h/proc.h"
+# endif
 #else /* KERNEL */
-#include <stdio.h>
+# include <stdio.h>
+# include "rx_user.h"
+# ifdef AFS_PTHREAD_ENV
+#  include "rx_pthread.h"
+# else
+#  include "rx_lwp.h"
+# endif
+# ifdef AFS_NT40_ENV
+#  include <malloc.h>
+# endif
+#endif /* KERNEL */
+
+#include "rx.h"
 #include "rx_clock.h"
 #include "rx_queue.h"
 #include "rx_event.h"
-#include "rx_user.h"
-#ifdef AFS_PTHREAD_ENV
-#include <rx/rx_pthread.h>
-#else
-#include "rx_lwp.h"
-#endif
-#ifdef RX_ENABLE_LOCKS
-#include "rx.h"
-#endif /* RX_ENABLE_LOCKS */
 #include "rx_globals.h"
-#ifdef AFS_NT40_ENV
-#include <malloc.h>
-#endif
-#endif /* KERNEL */
-
 
 /* All event processing is relative to the apparent current time given by clock_GetTime */
 
index 0859316..55f3e35 100644 (file)
 
 
 #ifndef KERNEL
-#ifndef AFS_NT40_ENV
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/time.h>
-#include <net/if.h>
-#include <netinet/in.h>
-#include <sys/ioctl.h>
-#include <string.h>
-#if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
-#include <sys/sysctl.h>
-#ifndef AFS_ARM_DARWIN_ENV
-#include <net/route.h>
-#endif
-#include <net/if_dl.h>
-#endif
+# ifndef AFS_NT40_ENV
+#  include <sys/types.h>
+#  include <sys/socket.h>
+#  include <sys/time.h>
+#  include <net/if.h>
+#  include <netinet/in.h>
+#  include <sys/ioctl.h>
+#  include <string.h>
+#  if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
+#   include <sys/sysctl.h>
+#   ifndef AFS_ARM_DARWIN_ENV
+#    include <net/route.h>
+#   endif
+#   include <net/if_dl.h>
+#  endif
 
 /*
  * By including this, we get any system dependencies. In particular,
  * the pthreads for solaris requires the socket call to be mapped.
  */
-#include "rx.h"
-#include "rx_globals.h"
-#endif /* AFS_NT40_ENV */
+#  include "rx.h"
+#  include "rx_globals.h"
+# endif /* AFS_NT40_ENV */
 #else /* KERNEL */
-#ifdef UKERNEL
-#include "rx/rx_kcommon.h"
-#else /* UKERNEL */
-#include "rx/rx.h"
-#endif /* UKERNEL */
+# ifdef UKERNEL
+#  include "rx/rx_kcommon.h"
+# else /* UKERNEL */
+#  include "rx/rx.h"
+# endif /* UKERNEL */
 #endif /* KERNEL */
 
 #define NIFS           512
 
 #if defined(AFS_USR_DFBSD_ENV)
-#include <net/if.h>
-#include <sys/sockio.h>
+# include <net/if.h>
+# include <sys/sockio.h>
 #endif
 
 #ifdef KERNEL
index 11128f5..763baa3 100644 (file)
 #endif
 
 #include <afsconfig.h>
-#ifdef KERNEL
 #include "afs/param.h"
-#else
-#include <afs/param.h>
-#endif
 
 
 /* Enable data initialization when the header file is included */
index 8675992..acca31b 100644 (file)
@@ -22,9 +22,9 @@
 #include <afs/param.h>
 
 
-# include <sys/types.h>                /* fd_set on older platforms */
-# include <errno.h>
-# include <signal.h>
+#include <sys/types.h>         /* fd_set on older platforms */
+#include <errno.h>
+#include <signal.h>
 #ifdef AFS_NT40_ENV
 # include <winsock2.h>
 #else
 # include <sys/ioctl.h>
 # include <sys/time.h>
 #endif
-# include "rx.h"
-# include "rx_atomic.h"
-# include "rx_globals.h"
-# include "rx_stats.h"
-# include <lwp.h>
+
+#include "rx.h"
+#include "rx_atomic.h"
+#include "rx_globals.h"
+#include "rx_stats.h"
+#include <lwp.h>
 
 #define MAXTHREADNAMELENGTH 64
 
index bdbeab2..d22e3d7 100644 (file)
 
 
 #ifdef KERNEL
-#include <afs/sysincludes.h>
-#include <afsincludes.h>
+# include <afs/sysincludes.h>
+# include <afsincludes.h>
 #else
-#ifdef AFS_NT40_ENV
-#include <winsock2.h>
-#include <malloc.h>
-#else
-#include <sys/param.h>
-#endif
-#include <errno.h>
-#include <afs/errors.h>
-#include "xdr.h"
-#ifdef AFS_PTHREAD_ENV
-#include "rx.h"
-#endif /* AFS_PTHREAD_ENV */
-#include <stdlib.h>
-#include <string.h>
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#ifdef AFS_NT40_ENV
-#ifndef EDQUOT
-#define EDQUOT WSAEDQUOT
-#endif /* EDQUOT */
-#endif /* AFS_NT40_ENV */
+# ifdef AFS_NT40_ENV
+#  include <winsock2.h>
+#  include <malloc.h>
+# else
+#  include <sys/param.h>
+# endif
+# include <errno.h>
+# include <afs/errors.h>
+# include "xdr.h"
+# ifdef AFS_PTHREAD_ENV
+#  include "rx.h"
+# endif /* AFS_PTHREAD_ENV */
+# include <stdlib.h>
+# include <string.h>
+# ifdef HAVE_UNISTD_H
+#  include <unistd.h>
+# endif
+# ifdef AFS_NT40_ENV
+#  ifndef EDQUOT
+#   define EDQUOT WSAEDQUOT
+#  endif /* EDQUOT */
+# endif /* AFS_NT40_ENV */
 #endif
 
 /*
index 56b8a89..704024a 100644 (file)
 
 #ifdef KERNEL
 #include "afs/sysincludes.h"
-#include "rx/rx.h"
-#else /* KERNEL */
-# include "rx.h"
-#endif /* KERNEL */
+#endif
+
+#include "rx.h"
 
 /*
  * multi.c and multi.h, together with some rxgen hooks, provide a way of
index 8334057..cc98bf4 100644 (file)
@@ -8,24 +8,18 @@
  */
 
 #include <afsconfig.h>
-#ifdef KERNEL
 #include "afs/param.h"
-#else
-#include <afs/param.h>
-#endif
-
 
 #ifdef KERNEL
-#ifndef        UKERNEL
-#include "h/types.h"
-#else /* !UKERNEL */
-#include "afs/sysincludes.h"
-#endif /* !UKERNEL */
-#include "rx/rx.h"
-#else /* KERNEL */
-#include "rx.h"
+# ifndef UKERNEL
+#  include "h/types.h"
+# else /* !UKERNEL */
+#  include "afs/sysincludes.h"
+# endif /* !UKERNEL */
 #endif /* KERNEL */
 
+#include "rx.h"
+
 /* The null security object.  No authentication, no nothing. */
 
 static struct rx_securityOps null_ops;
index 69471d9..69ccd66 100644 (file)
@@ -8,91 +8,74 @@
  */
 
 #include <afsconfig.h>
-#ifdef KERNEL
-#include "afs/param.h"
-#else
 #include <afs/param.h>
-#endif
 
 #ifdef KERNEL
-#if defined(UKERNEL)
-#include "afs/sysincludes.h"
-#include "afsincludes.h"
-#include "rx/rx_kcommon.h"
-#include "rx/rx_clock.h"
-#include "rx/rx_queue.h"
-#include "rx/rx_packet.h"
-#include "rx/rx_atomic.h"
-#include "rx/rx_internal.h"
-#include "rx/rx_stats.h"
-#else /* defined(UKERNEL) */
-#ifdef RX_KERNEL_TRACE
-#include "../rx/rx_kcommon.h"
-#endif
-#include "h/types.h"
-#ifndef AFS_LINUX20_ENV
-#include "h/systm.h"
-#endif
-#if defined(AFS_SGI_ENV) || defined(AFS_HPUX110_ENV) || defined(AFS_NBSD50_ENV)
-#include "afs/sysincludes.h"
-#endif
-#if defined(AFS_OBSD_ENV)
-#include "h/proc.h"
-#endif
-#include "h/socket.h"
-#if !defined(AFS_SUN5_ENV) &&  !defined(AFS_LINUX20_ENV) && !defined(AFS_HPUX110_ENV)
-#if    !defined(AFS_OSF_ENV) && !defined(AFS_AIX41_ENV)
-#include "sys/mount.h"         /* it gets pulled in by something later anyway */
-#endif
-#include "h/mbuf.h"
-#endif
-#include "netinet/in.h"
-#include "afs/afs_osi.h"
-#include "rx_kmutex.h"
-#include "rx/rx_clock.h"
-#include "rx/rx_queue.h"
-#include "rx_atomic.h"
-#ifdef AFS_SUN5_ENV
-#include <sys/sysmacros.h>
-#endif
-#include "rx/rx_packet.h"
-#include "rx_internal.h"
-#include "rx_stats.h"
-#endif /* defined(UKERNEL) */
-#include "rx/rx_globals.h"
+# if defined(UKERNEL)
+#  include "afs/sysincludes.h"
+#  include "afsincludes.h"
+#  include "rx_kcommon.h"
+# else /* defined(UKERNEL) */
+#  ifdef RX_KERNEL_TRACE
+#   include "rx_kcommon.h"
+#  endif
+#  include "h/types.h"
+#  ifndef AFS_LINUX20_ENV
+#   include "h/systm.h"
+#  endif
+#  if defined(AFS_SGI_ENV) || defined(AFS_HPUX110_ENV) || defined(AFS_NBSD50_ENV)
+#   include "afs/sysincludes.h"
+#  endif
+#  if defined(AFS_OBSD_ENV)
+#   include "h/proc.h"
+#  endif
+#  include "h/socket.h"
+#  if !defined(AFS_SUN5_ENV) &&  !defined(AFS_LINUX20_ENV) && !defined(AFS_HPUX110_ENV)
+#   if !defined(AFS_OSF_ENV) && !defined(AFS_AIX41_ENV)
+#    include "sys/mount.h"             /* it gets pulled in by something later anyway */
+#   endif
+#   include "h/mbuf.h"
+#  endif
+#  include "netinet/in.h"
+#  include "afs/afs_osi.h"
+#  include "rx_kmutex.h"
+# endif /* defined(UKERNEL) */
 #else /* KERNEL */
-#include "sys/types.h"
-#include <sys/stat.h>
-#include <errno.h>
-#if defined(AFS_NT40_ENV)
-#include <winsock2.h>
-#ifndef EWOULDBLOCK
-#define EWOULDBLOCK WSAEWOULDBLOCK
-#endif
-#include "rx_user.h"
-#include "rx_xmit_nt.h"
-#include <stdlib.h>
-#else
-#include <sys/socket.h>
-#include <netinet/in.h>
+# include <sys/types.h>
+# include <sys/stat.h>
+# include <errno.h>
+# include <stdlib.h>
+# include <assert.h>
+# include <string.h>
+# ifdef HAVE_UNISTD_H
+#  include <unistd.h>
+# endif
+# if defined(AFS_NT40_ENV)
+#  include <winsock2.h>
+#  ifndef EWOULDBLOCK
+#   define EWOULDBLOCK WSAEWOULDBLOCK
+#  endif
+#  include "rx_user.h"
+#  include "rx_xmit_nt.h"
+# else
+#  include <sys/socket.h>
+#  include <netinet/in.h>
+# endif
+# include <lwp.h>
+#endif /* KERNEL */
+
+#ifdef AFS_SUN5_ENV
+# include <sys/sysmacros.h>
 #endif
-#include "rx_clock.h"
+
 #include "rx.h"
+#include "rx_clock.h"
 #include "rx_queue.h"
-#ifdef AFS_SUN5_ENV
-#include <sys/sysmacros.h>
-#endif
 #include "rx_packet.h"
 #include "rx_atomic.h"
 #include "rx_globals.h"
 #include "rx_internal.h"
 #include "rx_stats.h"
-#include <lwp.h>
-#include <string.h>
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#endif /* KERNEL */
 
 #ifdef RX_LOCKS_DB
 /* rxdb_fileID is used to identify the lock location, along with line#. */
index ae92c67..ef63d89 100644 (file)
 # include <assert.h>
 #endif
 #include <sys/stat.h>
-#include <rx/rx.h>
-#include <rx/rx_globals.h>
-#include <rx/rx_pthread.h>
-#include <rx/rx_clock.h>
+
+#include "rx.h"
+#include "rx_globals.h"
+#include "rx_pthread.h"
+#include "rx_clock.h"
 #include "rx_atomic.h"
 
 /* Set rx_pthread_event_rescheduled if event_handler should just try
index 90f2015..dcc9fe1 100644 (file)
@@ -8,87 +8,70 @@
   */
 
 #include <afsconfig.h>
-#ifdef KERNEL
-#include "afs/param.h"
-#else
 #include <afs/param.h>
-#endif
-
 
 #ifdef KERNEL
-#ifndef UKERNEL
-#ifdef RX_KERNEL_TRACE
-#include "rx_kcommon.h"
-#endif
-#if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
-#include "afs/sysincludes.h"
-#else
-#include "h/types.h"
-#include "h/time.h"
-#include "h/stat.h"
-#if defined(AFS_AIX_ENV) || defined(AFS_AUX_ENV) || defined(AFS_SUN5_ENV)
-#include "h/systm.h"
-#endif
-#ifdef AFS_OSF_ENV
-#include <net/net_globals.h>
-#endif /* AFS_OSF_ENV */
-#ifdef AFS_LINUX20_ENV
-#include "h/socket.h"
-#endif
-#include "netinet/in.h"
-#if defined(AFS_SGI_ENV)
-#include "afs/sysincludes.h"
-#endif
-#endif
-#include "afs/afs_args.h"
-#include "afs/afs_osi.h"
-#if    (defined(AFS_AUX_ENV) || defined(AFS_AIX_ENV))
-#include "h/systm.h"
-#endif
-#else /* !UKERNEL */
-#include "afs/sysincludes.h"
-#endif /* !UKERNEL */
-#ifdef RXDEBUG
-#undef RXDEBUG                 /* turn off debugging */
-#endif /* RXDEBUG */
-
-#include "rx_kmutex.h"
-#include "rx/rx_kernel.h"
-#include "rx/rx_clock.h"
-#include "rx/rx_queue.h"
-#include "rx/rx.h"
-#include "rx/rx_globals.h"
-#include "afs/lock.h"
-#include "afsint.h"
-#ifdef  AFS_OSF_ENV
-#undef kmem_alloc
-#undef kmem_free
-#undef mem_alloc
-#undef mem_free
-#endif /* AFS_OSF_ENV */
+# ifndef UKERNEL
+#  ifdef RX_KERNEL_TRACE
+#   include "rx_kcommon.h"
+#  endif
+#  if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
+#   include "afs/sysincludes.h"
+#  else
+#   include "h/types.h"
+#   include "h/time.h"
+#   include "h/stat.h"
+#   if defined(AFS_AIX_ENV) || defined(AFS_AUX_ENV) || defined(AFS_SUN5_ENV)
+#    include "h/systm.h"
+#   endif
+#   ifdef      AFS_OSF_ENV
+#    include <net/net_globals.h>
+#   endif /* AFS_OSF_ENV */
+#   ifdef AFS_LINUX20_ENV
+#    include "h/socket.h"
+#   endif
+#   include "netinet/in.h"
+#   if defined(AFS_SGI_ENV)
+#    include "afs/sysincludes.h"
+#   endif
+#  endif
+#  include "afs/afs_args.h"
+#  if  (defined(AFS_AUX_ENV) || defined(AFS_AIX_ENV))
+#   include "h/systm.h"
+#  endif
+# else /* !UKERNEL */
+#  include "afs/sysincludes.h"
+# endif /* !UKERNEL */
+
+# ifdef RXDEBUG
+#  undef RXDEBUG                       /* turn off debugging */
+# endif /* RXDEBUG */
+
+# include "afs/afs_osi.h"
+# include "rx_kmutex.h"
+# include "rx/rx_kernel.h"
+# include "afs/lock.h"
 #else /* KERNEL */
 # include <sys/types.h>
-#ifdef AFS_NT40_ENV
-# include <winsock2.h>
-#else /* !AFS_NT40_ENV */
-# include <sys/socket.h>
-# include <sys/file.h>
-# include <netdb.h>
-# include <netinet/in.h>
-# include <sys/stat.h>
-# include <sys/time.h>
-#endif /* !AFS_NT40_ENV */
-#include <string.h>
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-# include "rx_user.h"
-# include "rx_clock.h"
-# include "rx_queue.h"
-# include "rx.h"
-# include "rx_globals.h"
+# include <string.h>
+# ifdef AFS_NT40_ENV
+#  include <winsock2.h>
+# else /* !AFS_NT40_ENV */
+#  include <sys/socket.h>
+#  include <sys/file.h>
+#  include <netdb.h>
+#  include <netinet/in.h>
+#  include <sys/stat.h>
+#  include <sys/time.h>
+#  include <unistd.h>
+# endif /* !AFS_NT40_ENV */
 #endif /* KERNEL */
 
+#include "rx.h"
+#include "rx_clock.h"
+#include "rx_queue.h"
+#include "rx_globals.h"
+
 #ifdef RX_LOCKS_DB
 /* rxdb_fileID is used to identify the lock location, along with line#. */
 static int rxdb_fileID = RXDB_FILE_RX_RDWR;
index b4fbbd5..85cff81 100644 (file)
@@ -29,6 +29,7 @@ main(int argc, char **argv)
 #include <sys/file.h>
 #include <unistd.h>
 #endif
+
 #include "rx.h"
 #include "rx_atomic.h"
 #include "rx_globals.h"
index 8fbeaf4..3dfe8f0 100644 (file)
 #include <afs/param.h>
 
 
-# include <sys/types.h>
-# include <errno.h>
-# include <signal.h>
-# include <string.h>
+#include <sys/types.h>
+#include <errno.h>
+#include <signal.h>
+#include <string.h>
 #ifdef AFS_NT40_ENV
 # include <WINNT/syscfg.h>
 #else
@@ -32,7 +32,7 @@
 # include <sys/ioctl.h>
 # include <unistd.h>
 #endif
-# include <fcntl.h>
+#include <fcntl.h>
 #if !defined(AFS_AIX_ENV) && !defined(AFS_NT40_ENV)
 # include <sys/syscall.h>
 #endif
@@ -57,6 +57,7 @@
 #ifndef AFS_NT40_ENV
 # include <sys/time.h>
 #endif
+
 #include "rx.h"
 #include "rx_atomic.h"
 #include "rx_globals.h"
index f88bdea..4c8f72d 100644 (file)
@@ -17,7 +17,6 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-
 #if defined(AFS_NT40_ENV)
 
 #include <winsock2.h>
index 057f7c2..830c178 100644 (file)
  */
 
 #include <afsconfig.h>
-#ifdef KERNEL
-#include "afs/param.h"
-#else
 #include <afs/param.h>
+
+#ifndef KERNEL
 #include <string.h>
 #endif
 
index 353f5a9..54dbf00 100644 (file)
  */
 
 #include <afsconfig.h>
-#ifdef KERNEL
-#include "afs/param.h"
-#else
 #include <afs/param.h>
-#endif
 
 
 #ifdef KERNEL
 # ifndef UKERNEL
 #  include "h/types.h"
 #  include "h/uio.h"
-#  ifdef AFS_OSF_ENV
-#   include <net/net_globals.h>
-#  endif /* AFS_OSF_ENV */
 #  ifdef AFS_LINUX20_ENV
 #   include "h/socket.h"
 #  else
 #   include "rpc/types.h"
 #  endif
-#  ifdef  AFS_OSF_ENV
-#   undef kmem_alloc
-#   undef kmem_free
-#   undef mem_alloc
-#   undef mem_free
-#  endif /* AFS_OSF_ENV */
 #  ifdef AFS_LINUX22_ENV
 #   ifndef quad_t
 #    define quad_t __quad_t
 #    define u_quad_t __u_quad_t
 #   endif
 #  endif
-#  include "rx/xdr.h"
 #  include "netinet/in.h"
 # endif /* !UKERNEL */
-# include "rx/xdr.h"
-# include "rx/rx.h"
-
 #else /* KERNEL */
 # include <sys/types.h>
 # include <stdio.h>
 # ifndef AFS_NT40_ENV
 #  include <netinet/in.h>
 # endif
-# include "rx.h"
-# include "xdr.h"
 #endif /* KERNEL */
 
+#include "rx.h"
+#include "xdr.h"
+
 /* Static prototypes */
 #ifdef AFS_XDR_64BITOPS
 static bool_t xdrrx_getint64(XDR *axdrs, long *lp);