viced: Tidy header includes
authorSimon Wilkinson <sxw@your-file-system.com>
Sat, 2 Apr 2011 13:17:41 +0000 (14:17 +0100)
committerJeffrey Altman <jaltman@openafs.org>
Mon, 4 Apr 2011 13:54:16 +0000 (06:54 -0700)
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 <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

acinclude.m4
src/viced/afsfileprocs.c
src/viced/callback.c
src/viced/check_sysid.c
src/viced/fsprobe.c
src/viced/host.c
src/viced/physio.c
src/viced/profile.c
src/viced/viced.c

index 8fd379b..7234677 100644 (file)
@@ -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 \
index 2349c04..9150406 100644 (file)
 
 #include <afsconfig.h>
 #include <afs/param.h>
+#include <afs/stds.h>
 
 #include <roken.h>
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <errno.h>
 #ifdef AFS_SGI_ENV
 #undef SHARED                  /* XXX */
 #endif
-#ifdef AFS_NT40_ENV
-#include <fcntl.h>
-#else
-#include <sys/param.h>
-#include <sys/file.h>
-#include <sys/ioctl.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <netdb.h>
-#include <string.h>
-
-#ifndef AFS_LINUX20_ENV
+
+#ifdef HAVE_NET_IF_H
 #include <net/if.h>
-#ifndef AFS_ARM_DARWIN_ENV
+#endif
+
+#ifdef HAVE_NETINET_IF_ETHER_H
 #include <netinet/if_ether.h>
 #endif
+
+#if !defined(AFS_SGI_ENV) && defined(HAVE_SYS_MAP_H)
+#include <sys/map.h>
 #endif
+
+#ifdef HAVE_SYS_STATFS_H
+#include <sys/statfs.h>
+#endif
+
+#ifdef HAVE_SYS_LOCKF_H
+#include <sys/lockf.h>
+#endif
+
+#ifdef HAVE_SYS_DK_H
+#include <sys/dk.h>
 #endif
+
 #ifdef AFS_HPUX_ENV
 /* included early because of name conflict on IOPEN */
 #include <sys/inode.h>
@@ -62,7 +66,7 @@
 #undef IOPEN
 #endif
 #endif /* AFS_HPUX_ENV */
-#include <afs/stds.h>
+
 #include <rx/xdr.h>
 #include <afs/nfs.h>
 #include <afs/afs_assert.h>
 #include <afs/acl.h>
 #include <rx/rx.h>
 #include <rx/rx_globals.h>
-#include <sys/stat.h>
-#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 <sys/map.h>
-#endif
-#if !defined(AFS_NT40_ENV)
-#include <unistd.h>
-#endif
-#if !defined(AFS_SGI_ENV) && !defined(AFS_NT40_ENV)
-#ifdef AFS_AIX_ENV
-#include <sys/statfs.h>
-#include <sys/lockf.h>
-#else
-#if !defined(AFS_SUN5_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_XBSD_ENV)
-#include <sys/dk.h>
-#endif
-#endif
-#endif
+
 #include <afs/cellconfig.h>
 #include <afs/keys.h>
 
-#include <signal.h>
 #include <afs/partition.h>
 #include "viced_prototypes.h"
 #include "viced.h"
index 8375c0b..073d563 100644 (file)
 
 #include <afsconfig.h>
 #include <afs/param.h>
+#include <afs/stds.h>
 
 #include <roken.h>
 
-#include <stdio.h>
-#include <stdlib.h>            /* for malloc() */
-#include <time.h>              /* ANSI standard location for time stuff */
-#include <string.h>
-#ifdef AFS_NT40_ENV
-#include <fcntl.h>
-#include <io.h>
-#else
-#include <sys/time.h>
+#ifdef HAVE_SYS_FILE_H
 #include <sys/file.h>
-#include <unistd.h>
 #endif
-#include <afs/afs_assert.h>
 
-#include <afs/stds.h>
+#include <afs/afs_assert.h>
 
 #include <afs/nfs.h>           /* yuck.  This is an abomination. */
 #include <lwp.h>
index 7c89a62..db6a202 100644 (file)
@@ -15,9 +15,8 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
+#include <roken.h>
 
-#include <fcntl.h>
-#include <errno.h>
 #include <afs/vldbint.h>
 
 #define SYSIDMAGIC      0x88aabbcc
index 8f19df9..59b5a38 100644 (file)
@@ -9,17 +9,13 @@
 
 #include <afsconfig.h>
 #include <afs/param.h>
+#include <afs/stds.h>
 
+#include <roken.h>
 
-#include <afs/stds.h>
 #include <afs/afsint.h>
-#include <sys/socket.h>
 #include <rx/rx_globals.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <netdb.h>
 #include <ubik.h>
-#include <string.h>
 
 struct ubik_client *cstruct;
 struct rx_connection *serverconns[MAXSERVERS];
index ae5b008..53330a3 100644 (file)
 
 #include <afsconfig.h>
 #include <afs/param.h>
+#include <afs/stds.h>
 
 #include <roken.h>
 
-#include <stdio.h>
-#include <errno.h>
-#include <string.h>
-#ifdef AFS_NT40_ENV
-#include <fcntl.h>
-#include <winsock2.h>
-#else
+#ifdef HAVE_SYS_FILE_H
 #include <sys/file.h>
-#include <netdb.h>
-#include <netinet/in.h>
 #endif
 
-#include <afs/stds.h>
 #include <rx/xdr.h>
 #include <afs/afs_assert.h>
 #include <lwp.h>
@@ -52,7 +44,6 @@
 #include <afs/com_err.h>
 #include <rx/rx.h>
 #include <afs/cellconfig.h>
-#include <stdlib.h>
 #include "viced_prototypes.h"
 #include "viced.h"
 #include "host.h"
index 2909262..1131c30 100644 (file)
 
 #include <roken.h>
 
-#include <stdio.h>
-#include <errno.h>
-#include <string.h>
-#ifdef AFS_NT40_ENV
-#include <fcntl.h>
-#else
+#ifdef HAVE_SYS_FILE_H
 #include <sys/file.h>
-#include <sys/time.h>
-#include <unistd.h>
 #endif
+
 #include <afs/nfs.h>
 #include <afs/afs_assert.h>
 #include <lwp.h>
 #include <lock.h>
-#include <time.h>
 #include <afs/afsint.h>
 #include <afs/ihandle.h>
 #include <afs/vnode.h>
index 1441985..9a62828 100644 (file)
 #include <afsconfig.h>
 #include <afs/param.h>
 
+#include <roken.h>
 
-#include <stdio.h>
+#ifdef HAVE_SYS_FILE_H
 #include <sys/file.h>
-#include <signal.h>
+#endif
 
 #if defined(sun) || defined(mac2)
 #define PROFSTART      0x8000
 #endif
 #define                SCALE_1_TO_1    0x10000L
 
-#ifdef AFS_OSF_ENV
-extern void *malloc();
-#else
-extern char *malloc();
-#endif
 extern int etext;
 void AllocProfBuf();
 
index ce327e5..7565e62 100644 (file)
 
 #include <afsconfig.h>
 #include <afs/param.h>
+#include <afs/stds.h>
 
 #include <afs/procmgmt.h>
 #include <roken.h>
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <string.h>
-#include <sys/types.h>
-#include <afs/procmgmt.h>      /* signal(), kill(), wait(), etc. */
-#include <sys/stat.h>
-#include <fcntl.h>
-#ifdef HAVE_STDINT_H
-# include <stdint.h>
-#endif
 #ifdef AFS_NT40_ENV
-#include <io.h>
 #include <windows.h>
 #include <WINNT/afsevent.h>
-#else
+#endif
+
+#ifdef HAVE_SYS_FILE_H
 #include <sys/file.h>
-#include <netinet/in.h>
-#include <netdb.h>
-#include <unistd.h>            /* sysconf() */
+#endif
 
-#ifndef ITIMER_REAL
-#include <sys/time.h>
-#endif /* ITIMER_REAL */
+#ifdef HAVE_SYS_RESOURCE_H
 #include <sys/resource.h>
-#endif /* AFS_NT40_ENV */
-#include <afs/stds.h>
+#endif
+
 #undef SHARED
+
 #include <rx/xdr.h>
 #include <afs/nfs.h>
 #include <afs/afs_assert.h>