From 5cdca3a638d079c80fca6425b5aab91197c70b46 Mon Sep 17 00:00:00 2001 From: Assar Westerlund Date: Fri, 11 Jul 1997 20:26:10 +0000 Subject: [PATCH] lots of includes and HAVE_FOO_H git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@2153 ec53bebd-3082-4978-b11e-865c3cabbd6b --- admin/admin_locl.h | 19 +++++++++++++++---- appl/rsh/rsh_locl.h | 19 +++++++++++++++++-- kdc/kdc_locl.h | 20 +++++++++++++++----- kuser/kuser_locl.h | 8 +++++++- lib/gssapi/gssapi.h | 6 ++---- lib/gssapi/krb5/gssapi.h | 6 ++---- lib/krb5/crc.h | 2 -- lib/krb5/krb5.h | 13 +++++++++---- lib/krb5/krb5_locl.h | 29 +++++++++++++++++++++++++---- lib/roken/getcwd.c | 4 ++++ lib/roken/getdtablesize.c | 4 ++++ lib/roken/hstrerror.c | 2 ++ lib/roken/memmove.c | 2 ++ lib/roken/roken.h | 4 ++-- lib/roken/roken.h.in | 4 ++-- lib/roken/setegid.c | 4 +++- lib/roken/seteuid.c | 2 ++ lib/roken/strftime.c | 2 ++ 18 files changed, 115 insertions(+), 35 deletions(-) diff --git a/admin/admin_locl.h b/admin/admin_locl.h index eca04703d..f0c918760 100644 --- a/admin/admin_locl.h +++ b/admin/admin_locl.h @@ -12,13 +12,24 @@ #include #include #include +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_FCNTL_H #include +#endif +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif +#ifdef HAVE_NETDB_H +#include +#endif +#include #include #include -#include -#include -#include -#include #include "hdb.h" diff --git a/appl/rsh/rsh_locl.h b/appl/rsh/rsh_locl.h index fea7f416b..ff6fe4498 100644 --- a/appl/rsh/rsh_locl.h +++ b/appl/rsh/rsh_locl.h @@ -7,21 +7,36 @@ #include #include #include -#include +#ifdef HAVE_SYS_TYPES_H #include +#endif +#ifdef HAVE_UNISTD_H +#include +#endif +#ifdef HAVE_SYS_SOCKET_H #include +#endif +#ifdef HAVE_NETINET_IN_H #include +#endif +#ifdef HAVE_PWD_H #include +#endif +#ifdef HAVE_NETDB_H #include +#endif #include + +#ifdef HAVE_SYSLOG_H #include +#endif #ifdef HAVE_PATHS_H #include #endif +#include #include #include #include -#include #ifndef _PATH_NOLOGIN #define _PATH_NOLOGIN "/etc/nologin" diff --git a/kdc/kdc_locl.h b/kdc/kdc_locl.h index 49140d02b..05a335c5a 100644 --- a/kdc/kdc_locl.h +++ b/kdc/kdc_locl.h @@ -13,15 +13,25 @@ #include #include #include +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_FCNTL_H #include +#endif +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif +#ifdef HAVE_NETDB_H +#include +#endif +#include #include #include -#include -#include -#include -#include -#include #include "hdb.h" extern struct timeval now; diff --git a/kuser/kuser_locl.h b/kuser/kuser_locl.h index 8e1f665d5..8d0972d87 100644 --- a/kuser/kuser_locl.h +++ b/kuser/kuser_locl.h @@ -10,9 +10,15 @@ #include #include #include -#include +#ifdef HAVE_SYS_TYPES_H #include +#endif +#ifdef HAVE_PWD_H +#include +#endif +#ifdef HAVE_SYS_TIME_H #include +#endif #include #include diff --git a/lib/gssapi/gssapi.h b/lib/gssapi/gssapi.h index cfaac41fd..75f6ebba4 100644 --- a/lib/gssapi/gssapi.h +++ b/lib/gssapi/gssapi.h @@ -12,16 +12,14 @@ #include #endif +#ifdef HAVE_SYS_TYPES_H #include +#endif #ifdef HAVE_NETINET_IN6_MACHTYPES_H #include #endif -#ifdef HAVE_SYS_BITYPES_H -#include -#endif - #include /* I don't want to include krb.h here */ diff --git a/lib/gssapi/krb5/gssapi.h b/lib/gssapi/krb5/gssapi.h index cfaac41fd..75f6ebba4 100644 --- a/lib/gssapi/krb5/gssapi.h +++ b/lib/gssapi/krb5/gssapi.h @@ -12,16 +12,14 @@ #include #endif +#ifdef HAVE_SYS_TYPES_H #include +#endif #ifdef HAVE_NETINET_IN6_MACHTYPES_H #include #endif -#ifdef HAVE_SYS_BITYPES_H -#include -#endif - #include /* I don't want to include krb.h here */ diff --git a/lib/krb5/crc.h b/lib/krb5/crc.h index c750e168e..a3be20414 100644 --- a/lib/krb5/crc.h +++ b/lib/krb5/crc.h @@ -1,6 +1,4 @@ /* $Id$ */ -#include - void crc_init_table (void); u_int32_t crc_update (char *p, size_t len, u_int32_t res); diff --git a/lib/krb5/krb5.h b/lib/krb5/krb5.h index 6d07393d7..44db1b918 100644 --- a/lib/krb5/krb5.h +++ b/lib/krb5/krb5.h @@ -3,14 +3,19 @@ #ifndef __KRB5_H__ #define __KRB5_H__ -#include -#include -#include - #ifdef HAVE_CONFIG_H #include #endif +#include + +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_SYS_TIME_H +#include +#endif + #ifdef HAVE_NETINET_IN6_MACHTYPES_H #include #endif diff --git a/lib/krb5/krb5_locl.h b/lib/krb5/krb5_locl.h index 84dfd2774..bc2ff6e07 100644 --- a/lib/krb5/krb5_locl.h +++ b/lib/krb5/krb5_locl.h @@ -13,21 +13,42 @@ #include #include -#include -#include +#ifdef HAVE_SYS_TYPES_H #include -#include -#include +#endif +#ifdef HAVE_UNISTD_H +#include +#endif +#ifdef HAVE_FCNTL_H +#include +#endif +#ifdef HAVE_SYS_IOCTL_H +#include +#endif +#ifdef HAVE_PWD_H +#include +#endif + +#ifdef HAVE_SYS_PARAM_H #include +#endif #include +#ifdef HAVE_SYS_TIME_H #include +#endif +#ifdef HAVE_SYS_SOCKET_H #include +#endif +#ifdef HAVE_NETINET_IN_H #include +#endif #ifdef HAVE_NETINET_IN6_H #include #endif +#ifdef HAVE_NETDB_H #include +#endif #ifdef HAVE_SYS_FILIO_H #include #endif diff --git a/lib/roken/getcwd.c b/lib/roken/getcwd.c index 2b8cf2858..b5ff1659c 100644 --- a/lib/roken/getcwd.c +++ b/lib/roken/getcwd.c @@ -41,8 +41,12 @@ RCSID("$Id$"); #endif +#ifdef HAVE_UNISTD_H #include +#endif +#ifdef HAVE_SYS_PARAM_H #include +#endif #include "roken.h" diff --git a/lib/roken/getdtablesize.c b/lib/roken/getdtablesize.c index 4a5f4ed5e..a74688102 100644 --- a/lib/roken/getdtablesize.c +++ b/lib/roken/getdtablesize.c @@ -43,7 +43,9 @@ RCSID("$Id$"); #include "roken.h" +#ifdef HAVE_SYS_TYPES_H #include +#endif #ifdef TIME_WITH_SYS_TIME #include #include @@ -55,7 +57,9 @@ RCSID("$Id$"); #ifdef HAVE_SYS_PARAM_H #include #endif +#ifdef HAVE_UNISTD_H #include +#endif #ifdef HAVE_SYS_RESOURCE_H #include diff --git a/lib/roken/hstrerror.c b/lib/roken/hstrerror.c index 0e01fc342..4ab4ba32d 100644 --- a/lib/roken/hstrerror.c +++ b/lib/roken/hstrerror.c @@ -46,7 +46,9 @@ RCSID("$Id$"); #ifndef HAVE_HSTRERROR #include +#ifdef HAVE_NETDB_H #include +#endif #ifndef HAVE_H_ERRNO int h_errno = -17; /* Some magic number */ diff --git a/lib/roken/memmove.c b/lib/roken/memmove.c index 4597ea224..ab970f710 100644 --- a/lib/roken/memmove.c +++ b/lib/roken/memmove.c @@ -45,7 +45,9 @@ RCSID("$Id$"); * memmove for systems that doesn't have it */ +#ifdef HAVE_SYS_TYPES_H #include +#endif void* memmove(void *s1, const void *s2, size_t n) { diff --git a/lib/roken/roken.h b/lib/roken/roken.h index ccdfc6efc..18e55f7f5 100644 --- a/lib/roken/roken.h +++ b/lib/roken/roken.h @@ -186,11 +186,11 @@ struct passwd *k_getpwuid (uid_t uid); #endif #ifndef HAVE_SETEUID -int seteuid(int euid); +int seteuid(uid_t euid); #endif #ifndef HAVE_SETEGID -int setegid(int egid); +int setegid(gid_t egid); #endif #ifndef HAVE_LSTAT diff --git a/lib/roken/roken.h.in b/lib/roken/roken.h.in index ccdfc6efc..18e55f7f5 100644 --- a/lib/roken/roken.h.in +++ b/lib/roken/roken.h.in @@ -186,11 +186,11 @@ struct passwd *k_getpwuid (uid_t uid); #endif #ifndef HAVE_SETEUID -int seteuid(int euid); +int seteuid(uid_t euid); #endif #ifndef HAVE_SETEGID -int setegid(int egid); +int setegid(gid_t egid); #endif #ifndef HAVE_LSTAT diff --git a/lib/roken/setegid.c b/lib/roken/setegid.c index 7a3d489e5..4bd557a10 100644 --- a/lib/roken/setegid.c +++ b/lib/roken/setegid.c @@ -41,12 +41,14 @@ RCSID("$Id$"); #endif +#ifdef HAVE_UNISTD_H #include +#endif #include "roken.h" int -setegid(int egid) +setegid(gid_t egid) { #ifdef HAVE_SETREGID return setregid(-1, egid); diff --git a/lib/roken/seteuid.c b/lib/roken/seteuid.c index 217020f15..2582bee50 100644 --- a/lib/roken/seteuid.c +++ b/lib/roken/seteuid.c @@ -41,7 +41,9 @@ RCSID("$Id$"); #endif +#ifdef HAVE_UNISTD_H #include +#endif #include "roken.h" diff --git a/lib/roken/strftime.c b/lib/roken/strftime.c index 3473778fd..673d448ea 100644 --- a/lib/roken/strftime.c +++ b/lib/roken/strftime.c @@ -34,7 +34,9 @@ #ifdef HAVE_CONFIG_H #include #endif +#ifdef HAVE_SYS_TYPES_H #include +#endif #ifdef TIME_WITH_SYS_TIME #include #include