From bc60093b976a4bbc7e416f7c8966abc406b42bb6 Mon Sep 17 00:00:00 2001 From: James Youngman Date: Sat, 2 Jul 2005 09:54:34 +0000 Subject: [PATCH] Assume unistd.h is present - avoid using HAVE_UNISTD_H --- configure.in | 3 ++- find/defs.h | 5 +++-- find/fstype.c | 5 +++-- find/parser.c | 8 ++++---- intl/dcigettext.c | 7 ++++--- lib/buildcmd.c | 5 +++-- lib/listfile.c | 6 ++++-- lib/savedirinfo.c | 7 ++++--- locate/locate.c | 5 +++-- xargs/xargs.c | 5 +++-- 10 files changed, 33 insertions(+), 23 deletions(-) diff --git a/configure.in b/configure.in index fad2478a..9332152d 100644 --- a/configure.in +++ b/configure.in @@ -80,7 +80,8 @@ AC_CHECK_FUNC(getpwnam, [], dnl Checks for header files. AC_HEADER_STDC -AC_CHECK_HEADERS(fcntl.h string.h limits.h unistd.h errno.h stdlib.h stddef.h) +dnl Assume unistd.h is present - coreutils does too. +AC_CHECK_HEADERS(fcntl.h string.h limits.h errno.h stdlib.h stddef.h) AC_CHECK_HEADERS(unistd.h sys/types.h inttypes.h fcntl.h locale.h stdint.h) AC_CHECK_HEADERS(sys/param.h mntent.h sys/mnttab.h sys/mntio.h sys/mkdev.h) dnl find.c needs sys/utsname.h because it calls uname(2). diff --git a/find/defs.h b/find/defs.h index 76275507..fe2c6846 100644 --- a/find/defs.h +++ b/find/defs.h @@ -45,9 +45,10 @@ extern int errno; #include #endif -#ifdef HAVE_UNISTD_H +/* The presence of unistd.h is assumed by gnulib these days, so we + * might as well assume it too. + */ #include -#endif #include diff --git a/find/fstype.c b/find/fstype.c index 2852e0e5..d2df6610 100644 --- a/find/fstype.c +++ b/find/fstype.c @@ -34,9 +34,10 @@ #include #endif -#ifdef HAVE_UNISTD_H +/* The presence of unistd.h is assumed by gnulib these days, so we + * might as well assume it too. + */ #include -#endif #ifdef HAVE_SYS_MNTIO_H #ifdef HAVE_FCNTL_H diff --git a/find/parser.c b/find/parser.c index f13daf43..bc335879 100644 --- a/find/parser.c +++ b/find/parser.c @@ -40,11 +40,11 @@ #include #endif -#ifdef HAVE_UNISTD_H +/* The presence of unistd.h is assumed by gnulib these days, so we + * might as well assume it too. + */ /* We need for isatty(). */ -#include -#endif - +#include #if ENABLE_NLS # include diff --git a/intl/dcigettext.c b/intl/dcigettext.c index e3657c9b..19122652 100644 --- a/intl/dcigettext.c +++ b/intl/dcigettext.c @@ -63,9 +63,10 @@ extern int errno; # endif #endif -#if defined HAVE_UNISTD_H || defined _LIBC -# include -#endif +/* The presence of unistd.h is assumed by gnulib these days, so we + * might as well assume it too. + */ +#include #include diff --git a/lib/buildcmd.c b/lib/buildcmd.c index e9ca95e7..474fc496 100644 --- a/lib/buildcmd.c +++ b/lib/buildcmd.c @@ -68,10 +68,11 @@ #include #endif -#ifdef HAVE_UNISTD_H +/* The presence of unistd.h is assumed by gnulib these days, so we + * might as well assume it too. + */ /* for sysconf() */ #include -#endif /* COMPAT: SYSV version defaults size (and has a max value of) to 470. We try to make it as large as possible. */ diff --git a/lib/listfile.c b/lib/listfile.c index 9720bb34..642f20a8 100644 --- a/lib/listfile.c +++ b/lib/listfile.c @@ -62,9 +62,11 @@ char *alloca (); #endif -#ifdef HAVE_UNISTD_H +/* The presence of unistd.h is assumed by gnulib these days, so we + * might as well assume it too. + */ #include /* for readlink() */ -#endif + #if STDC_HEADERS # include diff --git a/lib/savedirinfo.c b/lib/savedirinfo.c index 7b017702..1d2f9967 100644 --- a/lib/savedirinfo.c +++ b/lib/savedirinfo.c @@ -32,9 +32,10 @@ # include #endif -#if HAVE_UNISTD_H -# include -#endif +/* The presence of unistd.h is assumed by gnulib these days, so we + * might as well assume it too. + */ +#include #include diff --git a/locate/locate.c b/locate/locate.c index b1d73552..0b57452e 100644 --- a/locate/locate.c +++ b/locate/locate.c @@ -70,10 +70,11 @@ #include #include -#ifdef HAVE_UNISTD_H +/* The presence of unistd.h is assumed by gnulib these days, so we + * might as well assume it too. + */ /* We need for isatty(). */ #include -#endif #define NDEBUG diff --git a/xargs/xargs.c b/xargs/xargs.c index 30109738..014bbc5a 100644 --- a/xargs/xargs.c +++ b/xargs/xargs.c @@ -84,9 +84,10 @@ #define LONG_MAX (~(1 << (sizeof (long) * 8 - 1))) #endif -#ifdef HAVE_UNISTD_H +/* The presence of unistd.h is assumed by gnulib these days, so we + * might as well assume it too. + */ #include -#endif #include