From 410f98fc2b9bd775f809818590959272c04e6c9c Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sat, 2 Jul 2005 08:41:46 +0000 Subject: [PATCH] Assume HAVE_UNISTD_H, i.e., include unconditionally. --- lib/ChangeLog | 12 ++++++++++++ lib/backupfile.c | 4 +--- lib/canon-host.c | 4 +--- lib/canonicalize.c | 4 +--- lib/chown.c | 4 +--- lib/cloexec.c | 4 +--- lib/dup-safer.c | 4 +--- lib/dup2.c | 4 +--- lib/euidaccess.c | 5 +---- lib/fd-safer.c | 4 +--- lib/fileblocks.c | 4 +--- lib/fopen-safer.c | 4 +--- lib/fsusage.c | 4 +--- lib/ftruncate.c | 4 +--- lib/getcwd.c | 5 +---- lib/getcwd.h | 4 +--- lib/getloadavg.c | 4 +--- lib/getpagesize.h | 6 ++---- lib/getugroups.c | 4 +--- lib/group-member.c | 4 +--- lib/human.h | 4 +--- lib/idcache.c | 4 +--- lib/mkdir-p.c | 4 +--- lib/mountlist.c | 4 +--- lib/nanosleep.c | 4 +--- lib/pathmax.h | 4 +--- lib/physmem.c | 4 +--- lib/posixver.c | 4 +--- lib/putenv.c | 6 ++---- lib/raise.c | 4 +--- lib/safe-read.c | 4 +--- lib/same.c | 4 +--- lib/save-cwd.c | 4 +--- lib/setenv.c | 6 ++---- lib/settime.c | 4 +--- lib/tempname.c | 4 +--- lib/unlinkdir.c | 4 +--- lib/unsetenv.c | 6 ++---- lib/userspec.c | 4 +--- lib/xgethostname.c | 4 +--- lib/xreadlink.c | 4 +--- 41 files changed, 56 insertions(+), 126 deletions(-) diff --git a/lib/ChangeLog b/lib/ChangeLog index 52708dab86..abf855d1d9 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,15 @@ +2005-07-02 Jim Meyering + + * backupfile.c, canon-host.c, canonicalize.c, chown.c, cloexec.c: + * dup-safer.c, dup2.c, euidaccess.c, fd-safer.c, fileblocks.c: + * fopen-safer.c, fsusage.c, ftruncate.c, getcwd.c, getcwd.h: + * getloadavg.c, getopt_.h, getpagesize.h, getugroups.c, group-member.c: + * human.h, idcache.c, mkdir-p.c, mountlist.c, nanosleep.c, pathmax.h: + * physmem.c, posixver.c, putenv.c, raise.c, safe-read.c, same.c: + * save-cwd.c, setenv.c, settime.c, tempname.c, unlinkdir.c: + * unsetenv.c, userspec.c, xgethostname.c, xreadlink.c: + Assume HAVE_UNISTD_H, i.e., include unconditionally. + 2005-07-01 Jim Meyering * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c: diff --git a/lib/backupfile.c b/lib/backupfile.c index f48a1cde87..ebc0fce87a 100644 --- a/lib/backupfile.c +++ b/lib/backupfile.c @@ -38,9 +38,7 @@ #include -#if HAVE_UNISTD_H -# include -#endif +#include #if HAVE_DIRENT_H # include diff --git a/lib/canon-host.c b/lib/canon-host.c index 0d469ba1a4..63c437e1eb 100644 --- a/lib/canon-host.c +++ b/lib/canon-host.c @@ -24,9 +24,7 @@ #endif #include -#ifdef HAVE_UNISTD_H -# include -#endif +#include #include #include #ifdef HAVE_NETDB_H diff --git a/lib/canonicalize.c b/lib/canonicalize.c index 571fa19e23..b4d4c445b9 100644 --- a/lib/canonicalize.c +++ b/lib/canonicalize.c @@ -40,9 +40,7 @@ void free (); #include -#if HAVE_UNISTD_H -# include -#endif +#include #include #include diff --git a/lib/chown.c b/lib/chown.c index 2d97902e63..d6c64a48b3 100644 --- a/lib/chown.c +++ b/lib/chown.c @@ -27,9 +27,7 @@ #include #include -#if HAVE_UNISTD_H -# include -#endif +#include #include #include diff --git a/lib/cloexec.c b/lib/cloexec.c index 79d4ed0b8d..cfffa53b83 100644 --- a/lib/cloexec.c +++ b/lib/cloexec.c @@ -23,9 +23,7 @@ #include "cloexec.h" -#if HAVE_UNISTD_H -# include -#endif +#include #include diff --git a/lib/dup-safer.c b/lib/dup-safer.c index 034297aa1e..1c46b6e722 100644 --- a/lib/dup-safer.c +++ b/lib/dup-safer.c @@ -25,9 +25,7 @@ #include -#if HAVE_UNISTD_H -# include -#endif +#include #ifndef STDERR_FILENO # define STDERR_FILENO 2 #endif diff --git a/lib/dup2.c b/lib/dup2.c index 77deaf62d0..315c82b152 100644 --- a/lib/dup2.c +++ b/lib/dup2.c @@ -25,9 +25,7 @@ #include -#if HAVE_UNISTD_H -# include -#endif +#include #ifndef F_DUPFD static int diff --git a/lib/euidaccess.c b/lib/euidaccess.c index 4bb93aa0b0..4e1260b25b 100644 --- a/lib/euidaccess.c +++ b/lib/euidaccess.c @@ -32,10 +32,7 @@ #include #include - -#if HAVE_UNISTD_H || defined _LIBC -# include -#endif +#include #if HAVE_LIBGEN_H # include diff --git a/lib/fd-safer.c b/lib/fd-safer.c index 93768600f7..6b50451338 100644 --- a/lib/fd-safer.c +++ b/lib/fd-safer.c @@ -26,9 +26,7 @@ #include -#if HAVE_UNISTD_H -# include -#endif +#include #ifndef STDIN_FILENO # define STDIN_FILENO 0 #endif diff --git a/lib/fileblocks.c b/lib/fileblocks.c index dd6fb6d3a7..9367176e34 100644 --- a/lib/fileblocks.c +++ b/lib/fileblocks.c @@ -30,9 +30,7 @@ #if !HAVE_STRUCT_STAT_ST_BLOCKS && !defined _POSIX_SOURCE && defined BSIZE -# if HAVE_UNISTD_H -# include -# endif +# include # ifndef NINDIR diff --git a/lib/fopen-safer.c b/lib/fopen-safer.c index 1eb594b32f..4b74b8f3bf 100644 --- a/lib/fopen-safer.c +++ b/lib/fopen-safer.c @@ -21,9 +21,7 @@ # include #endif -#if HAVE_UNISTD_H -# include -#endif +#include #include #ifndef STDERR_FILENO diff --git a/lib/fsusage.c b/lib/fsusage.c index 83d26af88b..81c28690f3 100644 --- a/lib/fsusage.c +++ b/lib/fsusage.c @@ -27,9 +27,7 @@ #if HAVE_STDINT_H # include #endif -#if HAVE_UNISTD_H -# include -#endif +#include #ifndef UINTMAX_MAX # define UINTMAX_MAX ((uintmax_t) -1) #endif diff --git a/lib/ftruncate.c b/lib/ftruncate.c index c062fe80d8..669d594903 100644 --- a/lib/ftruncate.c +++ b/lib/ftruncate.c @@ -23,9 +23,7 @@ ftruncate (int fd, off_t length) # include # include -# if HAVE_UNISTD_H -# include -# endif +# include int ftruncate (int fd, off_t length) diff --git a/lib/getcwd.c b/lib/getcwd.c index 86070ead87..be10e4f1b8 100644 --- a/lib/getcwd.c +++ b/lib/getcwd.c @@ -60,10 +60,7 @@ # define _D_ALLOC_NAMLEN(d) (_D_EXACT_NAMLEN (d) + 1) #endif -#if HAVE_UNISTD_H || _LIBC -# include -#endif - +#include #include #include diff --git a/lib/getcwd.h b/lib/getcwd.h index d69fe206b8..0503ff8247 100644 --- a/lib/getcwd.h +++ b/lib/getcwd.h @@ -22,9 +22,7 @@ cause confusion if included after this file. */ #include -#if HAVE_UNISTD_H -# include -#endif +#include /* If necessary, systematically rename identifiers so that they do not collide with the system function. Renaming avoids problems with diff --git a/lib/getloadavg.c b/lib/getloadavg.c index d1ed95af48..9a4988e8b0 100644 --- a/lib/getloadavg.c +++ b/lib/getloadavg.c @@ -346,9 +346,7 @@ # define LDAV_SYMBOL "avenrun" # endif -# ifdef HAVE_UNISTD_H -# include -# endif +# include /* LOAD_AVE_TYPE should only get defined if we're going to use the nlist method. */ diff --git a/lib/getpagesize.h b/lib/getpagesize.h index 17f070f634..5cce3c9080 100644 --- a/lib/getpagesize.h +++ b/lib/getpagesize.h @@ -1,5 +1,5 @@ /* Emulate getpagesize on systems that lack it. - Copyright (C) 1999, 2000, 2004 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2004, 2005 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -18,9 +18,7 @@ #ifndef HAVE_GETPAGESIZE -#ifdef HAVE_UNISTD_H -# include -#endif +#include #if !defined getpagesize && defined _SC_PAGESIZE # if !(defined VMS && __VMS_VER < 70000000) diff --git a/lib/getugroups.c b/lib/getugroups.c index 599bf1cead..60b04682a6 100644 --- a/lib/getugroups.c +++ b/lib/getugroups.c @@ -27,9 +27,7 @@ #include /* grp.h on alpha OSF1 V2.0 uses "FILE *". */ #include -#ifdef HAVE_UNISTD_H -# include -#endif +#include #include #ifndef EOVERFLOW diff --git a/lib/group-member.c b/lib/group-member.c index 67fb9fd7c1..a338674b2c 100644 --- a/lib/group-member.c +++ b/lib/group-member.c @@ -26,9 +26,7 @@ #include #include -#if HAVE_UNISTD_H -# include -#endif +#include #include "xalloc.h" diff --git a/lib/human.h b/lib/human.h index 3b23c123b8..15ca36bf83 100644 --- a/lib/human.h +++ b/lib/human.h @@ -32,9 +32,7 @@ # if HAVE_STDINT_H # include # endif -# if HAVE_UNISTD_H -# include -# endif +# include /* A conservative bound on the maximum length of a human-readable string. The output can be the square of the largest uintmax_t, so double diff --git a/lib/idcache.c b/lib/idcache.c index 82dec8d90c..0673d80fc1 100644 --- a/lib/idcache.c +++ b/lib/idcache.c @@ -27,9 +27,7 @@ #include #include -#if HAVE_UNISTD_H -# include -#endif +#include #include "xalloc.h" diff --git a/lib/mkdir-p.c b/lib/mkdir-p.c index 962f452bd3..315a3a06a9 100644 --- a/lib/mkdir-p.c +++ b/lib/mkdir-p.c @@ -30,9 +30,7 @@ #include #include #include -#if HAVE_UNISTD_H -# include -#endif +#include #include #include diff --git a/lib/mountlist.c b/lib/mountlist.c index a8ef87d8c8..da39daaef8 100644 --- a/lib/mountlist.c +++ b/lib/mountlist.c @@ -37,9 +37,7 @@ char *strstr (); #include -#ifdef HAVE_UNISTD_H -# include -#endif +#include #if HAVE_SYS_PARAM_H # include diff --git a/lib/nanosleep.c b/lib/nanosleep.c index f41aed2cf3..97d60d864f 100644 --- a/lib/nanosleep.c +++ b/lib/nanosleep.c @@ -30,9 +30,7 @@ #include -#if HAVE_UNISTD_H -# include -#endif +#include #include "timespec.h" diff --git a/lib/pathmax.h b/lib/pathmax.h index 613c56c097..6941e457e3 100644 --- a/lib/pathmax.h +++ b/lib/pathmax.h @@ -18,9 +18,7 @@ #ifndef _PATHMAX_H # define _PATHMAX_H -# if HAVE_UNISTD_H -# include -# endif +# include # include diff --git a/lib/physmem.c b/lib/physmem.c index dabb00ccbe..99fc8465b8 100644 --- a/lib/physmem.c +++ b/lib/physmem.c @@ -23,9 +23,7 @@ #include "physmem.h" -#if HAVE_UNISTD_H -# include -#endif +#include #if HAVE_SYS_PSTAT_H # include diff --git a/lib/posixver.c b/lib/posixver.c index 2fa097ae6c..7fd7cd3b88 100644 --- a/lib/posixver.c +++ b/lib/posixver.c @@ -27,9 +27,7 @@ #include #include -#if HAVE_UNISTD_H -# include -#endif +#include #ifndef _POSIX2_VERSION # define _POSIX2_VERSION 0 #endif diff --git a/lib/putenv.c b/lib/putenv.c index 69fb90be61..0a23694fac 100644 --- a/lib/putenv.c +++ b/lib/putenv.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1994, 1997, 1998, 2000, 2003, 2004 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1994, 1997, 1998, 2000, 2003, 2004, 2005 Free Software Foundation, Inc. NOTE: The canonical source of this file is maintained with the GNU C Library. Bugs can be reported to bug-glibc@prep.ai.mit.edu. @@ -39,9 +39,7 @@ void free (); #include -#if defined (__GNU_LIBRARY__) || defined (HAVE_UNISTD_H) -# include -#endif +#include #if HAVE_GNU_LD # define environ __environ diff --git a/lib/raise.c b/lib/raise.c index 8eeea5c890..1225f764e4 100644 --- a/lib/raise.c +++ b/lib/raise.c @@ -21,9 +21,7 @@ #include #include -#if HAVE_UNISTD_H -# include -#endif +#include int raise (int sig) diff --git a/lib/safe-read.c b/lib/safe-read.c index 904fc71f03..a5108356d9 100644 --- a/lib/safe-read.c +++ b/lib/safe-read.c @@ -30,9 +30,7 @@ /* Get ssize_t. */ #include -#if HAVE_UNISTD_H -# include -#endif +#include #include diff --git a/lib/same.c b/lib/same.c index 89ee47dd09..9cbf47a76b 100644 --- a/lib/same.c +++ b/lib/same.c @@ -25,9 +25,7 @@ #include #include -#ifdef HAVE_UNISTD_H -# include -#endif +#include #include #include #include diff --git a/lib/save-cwd.c b/lib/save-cwd.c index 5ad790a4d3..aefdb6e7e4 100644 --- a/lib/save-cwd.c +++ b/lib/save-cwd.c @@ -29,9 +29,7 @@ #include #include -#if HAVE_UNISTD_H -# include -#endif +#include #include diff --git a/lib/setenv.c b/lib/setenv.c index 33dbeb7a39..8088200910 100644 --- a/lib/setenv.c +++ b/lib/setenv.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1992,1995-1999,2000-2003 Free Software Foundation, Inc. +/* Copyright (C) 1992,1995-1999,2000-2003,2005 Free Software Foundation, Inc. This file is part of the GNU C Library. This program is free software; you can redistribute it and/or modify @@ -27,9 +27,7 @@ #include #include -#if _LIBC || HAVE_UNISTD_H -# include -#endif +#include #if !_LIBC # include "allocsa.h" diff --git a/lib/settime.c b/lib/settime.c index 459d5436cb..20edeab288 100644 --- a/lib/settime.c +++ b/lib/settime.c @@ -23,9 +23,7 @@ #include "timespec.h" -#if HAVE_UNISTD_H -# include -#endif +#include #include diff --git a/lib/tempname.c b/lib/tempname.c index 4b0fad3f87..27663c23c5 100644 --- a/lib/tempname.c +++ b/lib/tempname.c @@ -60,9 +60,7 @@ # include #endif -#if HAVE_UNISTD_H || _LIBC -# include -#endif +#include #include diff --git a/lib/unlinkdir.c b/lib/unlinkdir.c index b12d2a4925..4d53fa02f9 100644 --- a/lib/unlinkdir.c +++ b/lib/unlinkdir.c @@ -25,9 +25,7 @@ #if HAVE_PRIV_H # include #endif -#if HAVE_UNISTD_H -# include -#endif +#include #if ! UNLINK_CANNOT_UNLINK_DIR diff --git a/lib/unsetenv.c b/lib/unsetenv.c index 4b53fc9c8b..d96389656e 100644 --- a/lib/unsetenv.c +++ b/lib/unsetenv.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1992,1995-1999,2000-2002 Free Software Foundation, Inc. +/* Copyright (C) 1992,1995-1999,2000-2002,2005 Free Software Foundation, Inc. This file is part of the GNU C Library. This program is free software; you can redistribute it and/or modify @@ -29,9 +29,7 @@ extern int errno; #include #include -#if _LIBC || HAVE_UNISTD_H -# include -#endif +#include #if !_LIBC # define __environ environ diff --git a/lib/userspec.c b/lib/userspec.c index 5f5c5bf43c..d09a6b2126 100644 --- a/lib/userspec.c +++ b/lib/userspec.c @@ -39,9 +39,7 @@ #include #include -#if HAVE_UNISTD_H -# include -#endif +#include #include "intprops.h" #include "inttostr.h" diff --git a/lib/xgethostname.c b/lib/xgethostname.c index 5b8b9b2e86..2facf9b1dd 100644 --- a/lib/xgethostname.c +++ b/lib/xgethostname.c @@ -29,9 +29,7 @@ #include #include -#if HAVE_UNISTD_H -# include -#endif +#include #include "xalloc.h" diff --git a/lib/xreadlink.c b/lib/xreadlink.c index d56d2a6af4..63f5ce1bfa 100644 --- a/lib/xreadlink.c +++ b/lib/xreadlink.c @@ -30,9 +30,7 @@ #include #include #include -#if HAVE_UNISTD_H -# include -#endif +#include #ifndef SIZE_MAX # define SIZE_MAX ((size_t) -1) -- 2.47.3