From bda87d7943d97a02fcc70e48caad65c09e2421b0 Mon Sep 17 00:00:00 2001 From: Simon Wilkinson Date: Sat, 2 Apr 2011 14:17:41 +0100 Subject: [PATCH] viced: Tidy header includes Remove headers which are provided by libroken, and reorder header includes so that they're a bit a more legible. Also add a selection of headers to the list that autoconf checks for Change-Id: Ic76bb02ff5353ceba380b78abc294251ecc66267 Reviewed-on: http://gerrit.openafs.org/4418 Reviewed-by: Derrick Brashear Reviewed-by: Jeffrey Altman Tested-by: Jeffrey Altman --- acinclude.m4 | 5 ++++ src/viced/afsfileprocs.c | 59 ++++++++++++++++------------------------ src/viced/callback.c | 15 ++-------- src/viced/check_sysid.c | 3 +- src/viced/fsprobe.c | 8 ++---- src/viced/host.c | 13 ++------- src/viced/physio.c | 11 ++------ src/viced/profile.c | 10 ++----- src/viced/viced.c | 30 ++++++-------------- 9 files changed, 50 insertions(+), 104 deletions(-) diff --git a/acinclude.m4 b/acinclude.m4 index 8fd379b11..7234677e3 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -1228,7 +1228,9 @@ AC_CHECK_HEADERS([ \ math.h \ mntent.h \ ncurses.h \ + net/if.h \ netdb.h \ + netinet/if_ether.h \ netinet/in.h \ pwd.h \ regex.h \ @@ -1242,12 +1244,15 @@ AC_CHECK_HEADERS([ \ strings.h \ sys/bitypes.h \ sys/bswap.h \ + sys/dk.h \ sys/fcntl.h \ sys/file.h \ sys/fs_types.h \ sys/fstyp.h \ sys/ioctl.h \ sys/ipc.h \ + sys/lockf.h \ + sys/map.h \ sys/mount.h \ sys/mntent.h \ sys/mnttab.h \ diff --git a/src/viced/afsfileprocs.c b/src/viced/afsfileprocs.c index 2349c0415..9150406d3 100644 --- a/src/viced/afsfileprocs.c +++ b/src/viced/afsfileprocs.c @@ -27,34 +27,38 @@ #include #include +#include #include -#include -#include -#include #ifdef AFS_SGI_ENV #undef SHARED /* XXX */ #endif -#ifdef AFS_NT40_ENV -#include -#else -#include -#include -#include -#include -#include -#include -#include -#include - -#ifndef AFS_LINUX20_ENV + +#ifdef HAVE_NET_IF_H #include -#ifndef AFS_ARM_DARWIN_ENV +#endif + +#ifdef HAVE_NETINET_IF_ETHER_H #include #endif + +#if !defined(AFS_SGI_ENV) && defined(HAVE_SYS_MAP_H) +#include #endif + +#ifdef HAVE_SYS_STATFS_H +#include +#endif + +#ifdef HAVE_SYS_LOCKF_H +#include +#endif + +#ifdef HAVE_SYS_DK_H +#include #endif + #ifdef AFS_HPUX_ENV /* included early because of name conflict on IOPEN */ #include @@ -62,7 +66,7 @@ #undef IOPEN #endif #endif /* AFS_HPUX_ENV */ -#include + #include #include #include @@ -80,27 +84,10 @@ #include #include #include -#include -#if ! defined(AFS_SGI_ENV) && ! defined(AFS_AIX32_ENV) && ! defined(AFS_NT40_ENV) && ! defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_XBSD_ENV) -#include -#endif -#if !defined(AFS_NT40_ENV) -#include -#endif -#if !defined(AFS_SGI_ENV) && !defined(AFS_NT40_ENV) -#ifdef AFS_AIX_ENV -#include -#include -#else -#if !defined(AFS_SUN5_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_XBSD_ENV) -#include -#endif -#endif -#endif + #include #include -#include #include #include "viced_prototypes.h" #include "viced.h" diff --git a/src/viced/callback.c b/src/viced/callback.c index 8375c0b2c..073d56323 100644 --- a/src/viced/callback.c +++ b/src/viced/callback.c @@ -83,24 +83,15 @@ #include #include +#include #include -#include -#include /* for malloc() */ -#include /* ANSI standard location for time stuff */ -#include -#ifdef AFS_NT40_ENV -#include -#include -#else -#include +#ifdef HAVE_SYS_FILE_H #include -#include #endif -#include -#include +#include #include /* yuck. This is an abomination. */ #include diff --git a/src/viced/check_sysid.c b/src/viced/check_sysid.c index 7c89a6218..db6a202a3 100644 --- a/src/viced/check_sysid.c +++ b/src/viced/check_sysid.c @@ -15,9 +15,8 @@ #include #include +#include -#include -#include #include #define SYSIDMAGIC 0x88aabbcc diff --git a/src/viced/fsprobe.c b/src/viced/fsprobe.c index 8f19df986..59b5a3881 100644 --- a/src/viced/fsprobe.c +++ b/src/viced/fsprobe.c @@ -9,17 +9,13 @@ #include #include +#include +#include -#include #include -#include #include -#include -#include -#include #include -#include struct ubik_client *cstruct; struct rx_connection *serverconns[MAXSERVERS]; diff --git a/src/viced/host.c b/src/viced/host.c index ae5b008c2..53330a335 100644 --- a/src/viced/host.c +++ b/src/viced/host.c @@ -11,22 +11,14 @@ #include #include +#include #include -#include -#include -#include -#ifdef AFS_NT40_ENV -#include -#include -#else +#ifdef HAVE_SYS_FILE_H #include -#include -#include #endif -#include #include #include #include @@ -52,7 +44,6 @@ #include #include #include -#include #include "viced_prototypes.h" #include "viced.h" #include "host.h" diff --git a/src/viced/physio.c b/src/viced/physio.c index 290926209..1131c30de 100644 --- a/src/viced/physio.c +++ b/src/viced/physio.c @@ -18,21 +18,14 @@ #include -#include -#include -#include -#ifdef AFS_NT40_ENV -#include -#else +#ifdef HAVE_SYS_FILE_H #include -#include -#include #endif + #include #include #include #include -#include #include #include #include diff --git a/src/viced/profile.c b/src/viced/profile.c index 14419854e..9a62828a0 100644 --- a/src/viced/profile.c +++ b/src/viced/profile.c @@ -12,10 +12,11 @@ #include #include +#include -#include +#ifdef HAVE_SYS_FILE_H #include -#include +#endif #if defined(sun) || defined(mac2) #define PROFSTART 0x8000 @@ -34,11 +35,6 @@ #endif #define SCALE_1_TO_1 0x10000L -#ifdef AFS_OSF_ENV -extern void *malloc(); -#else -extern char *malloc(); -#endif extern int etext; void AllocProfBuf(); diff --git a/src/viced/viced.c b/src/viced/viced.c index ce327e577..7565e6251 100644 --- a/src/viced/viced.c +++ b/src/viced/viced.c @@ -20,38 +20,26 @@ #include #include +#include #include #include -#include -#include -#include -#include -#include -#include /* signal(), kill(), wait(), etc. */ -#include -#include -#ifdef HAVE_STDINT_H -# include -#endif #ifdef AFS_NT40_ENV -#include #include #include -#else +#endif + +#ifdef HAVE_SYS_FILE_H #include -#include -#include -#include /* sysconf() */ +#endif -#ifndef ITIMER_REAL -#include -#endif /* ITIMER_REAL */ +#ifdef HAVE_SYS_RESOURCE_H #include -#endif /* AFS_NT40_ENV */ -#include +#endif + #undef SHARED + #include #include #include -- 2.39.5