diff options
41 files changed, 56 insertions, 126 deletions
diff --git a/lib/ChangeLog b/lib/ChangeLog index 52708dab8..abf855d1d 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,15 @@ +2005-07-02 Jim Meyering <jim@meyering.net> + + * 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 <unistd.h> unconditionally. + 2005-07-01 Jim Meyering <jim@meyering.net> * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c: diff --git a/lib/backupfile.c b/lib/backupfile.c index f48a1cde8..ebc0fce87 100644 --- a/lib/backupfile.c +++ b/lib/backupfile.c @@ -38,9 +38,7 @@ #include <limits.h> -#if HAVE_UNISTD_H -# include <unistd.h> -#endif +#include <unistd.h> #if HAVE_DIRENT_H # include <dirent.h> diff --git a/lib/canon-host.c b/lib/canon-host.c index 0d469ba1a..63c437e1e 100644 --- a/lib/canon-host.c +++ b/lib/canon-host.c @@ -24,9 +24,7 @@ #endif #include <sys/types.h> -#ifdef HAVE_UNISTD_H -# include <unistd.h> -#endif +#include <unistd.h> #include <stdlib.h> #include <string.h> #ifdef HAVE_NETDB_H diff --git a/lib/canonicalize.c b/lib/canonicalize.c index 571fa19e2..b4d4c445b 100644 --- a/lib/canonicalize.c +++ b/lib/canonicalize.c @@ -40,9 +40,7 @@ void free (); #include <sys/stat.h> -#if HAVE_UNISTD_H -# include <unistd.h> -#endif +#include <unistd.h> #include <errno.h> #include <stddef.h> diff --git a/lib/chown.c b/lib/chown.c index 2d97902e6..d6c64a48b 100644 --- a/lib/chown.c +++ b/lib/chown.c @@ -27,9 +27,7 @@ #include <sys/types.h> #include <sys/stat.h> -#if HAVE_UNISTD_H -# include <unistd.h> -#endif +#include <unistd.h> #include <fcntl.h> #include <errno.h> diff --git a/lib/cloexec.c b/lib/cloexec.c index 79d4ed0b8..cfffa53b8 100644 --- a/lib/cloexec.c +++ b/lib/cloexec.c @@ -23,9 +23,7 @@ #include "cloexec.h" -#if HAVE_UNISTD_H -# include <unistd.h> -#endif +#include <unistd.h> #include <fcntl.h> diff --git a/lib/dup-safer.c b/lib/dup-safer.c index 034297aa1..1c46b6e72 100644 --- a/lib/dup-safer.c +++ b/lib/dup-safer.c @@ -25,9 +25,7 @@ #include <fcntl.h> -#if HAVE_UNISTD_H -# include <unistd.h> -#endif +#include <unistd.h> #ifndef STDERR_FILENO # define STDERR_FILENO 2 #endif diff --git a/lib/dup2.c b/lib/dup2.c index 77deaf62d..315c82b15 100644 --- a/lib/dup2.c +++ b/lib/dup2.c @@ -25,9 +25,7 @@ #include <fcntl.h> -#if HAVE_UNISTD_H -# include <unistd.h> -#endif +#include <unistd.h> #ifndef F_DUPFD static int diff --git a/lib/euidaccess.c b/lib/euidaccess.c index 4bb93aa0b..4e1260b25 100644 --- a/lib/euidaccess.c +++ b/lib/euidaccess.c @@ -32,10 +32,7 @@ #include <sys/types.h> #include <sys/stat.h> - -#if HAVE_UNISTD_H || defined _LIBC -# include <unistd.h> -#endif +#include <unistd.h> #if HAVE_LIBGEN_H # include <libgen.h> diff --git a/lib/fd-safer.c b/lib/fd-safer.c index 93768600f..6b5045133 100644 --- a/lib/fd-safer.c +++ b/lib/fd-safer.c @@ -26,9 +26,7 @@ #include <errno.h> -#if HAVE_UNISTD_H -# include <unistd.h> -#endif +#include <unistd.h> #ifndef STDIN_FILENO # define STDIN_FILENO 0 #endif diff --git a/lib/fileblocks.c b/lib/fileblocks.c index dd6fb6d3a..9367176e3 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 <unistd.h> -# endif +# include <unistd.h> # ifndef NINDIR diff --git a/lib/fopen-safer.c b/lib/fopen-safer.c index 1eb594b32..4b74b8f3b 100644 --- a/lib/fopen-safer.c +++ b/lib/fopen-safer.c @@ -21,9 +21,7 @@ # include <config.h> #endif -#if HAVE_UNISTD_H -# include <unistd.h> -#endif +#include <unistd.h> #include <unistd-safer.h> #ifndef STDERR_FILENO diff --git a/lib/fsusage.c b/lib/fsusage.c index 83d26af88..81c28690f 100644 --- a/lib/fsusage.c +++ b/lib/fsusage.c @@ -27,9 +27,7 @@ #if HAVE_STDINT_H # include <stdint.h> #endif -#if HAVE_UNISTD_H -# include <unistd.h> -#endif +#include <unistd.h> #ifndef UINTMAX_MAX # define UINTMAX_MAX ((uintmax_t) -1) #endif diff --git a/lib/ftruncate.c b/lib/ftruncate.c index c062fe80d..669d59490 100644 --- a/lib/ftruncate.c +++ b/lib/ftruncate.c @@ -23,9 +23,7 @@ ftruncate (int fd, off_t length) # include <sys/stat.h> # include <errno.h> -# if HAVE_UNISTD_H -# include <unistd.h> -# endif +# include <unistd.h> int ftruncate (int fd, off_t length) diff --git a/lib/getcwd.c b/lib/getcwd.c index 86070ead8..be10e4f1b 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 <unistd.h> -#endif - +#include <unistd.h> #include <stdlib.h> #include <string.h> diff --git a/lib/getcwd.h b/lib/getcwd.h index d69fe206b..0503ff824 100644 --- a/lib/getcwd.h +++ b/lib/getcwd.h @@ -22,9 +22,7 @@ cause confusion if included after this file. */ #include <stdlib.h> -#if HAVE_UNISTD_H -# include <unistd.h> -#endif +#include <unistd.h> /* 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 d1ed95af4..9a4988e8b 100644 --- a/lib/getloadavg.c +++ b/lib/getloadavg.c @@ -346,9 +346,7 @@ # define LDAV_SYMBOL "avenrun" # endif -# ifdef HAVE_UNISTD_H -# include <unistd.h> -# endif +# include <unistd.h> /* 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 17f070f63..5cce3c908 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 <unistd.h> -#endif +#include <unistd.h> #if !defined getpagesize && defined _SC_PAGESIZE # if !(defined VMS && __VMS_VER < 70000000) diff --git a/lib/getugroups.c b/lib/getugroups.c index 599bf1cea..60b04682a 100644 --- a/lib/getugroups.c +++ b/lib/getugroups.c @@ -27,9 +27,7 @@ #include <stdio.h> /* grp.h on alpha OSF1 V2.0 uses "FILE *". */ #include <grp.h> -#ifdef HAVE_UNISTD_H -# include <unistd.h> -#endif +#include <unistd.h> #include <errno.h> #ifndef EOVERFLOW diff --git a/lib/group-member.c b/lib/group-member.c index 67fb9fd7c..a338674b2 100644 --- a/lib/group-member.c +++ b/lib/group-member.c @@ -26,9 +26,7 @@ #include <sys/types.h> #include <stdlib.h> -#if HAVE_UNISTD_H -# include <unistd.h> -#endif +#include <unistd.h> #include "xalloc.h" diff --git a/lib/human.h b/lib/human.h index 3b23c123b..15ca36bf8 100644 --- a/lib/human.h +++ b/lib/human.h @@ -32,9 +32,7 @@ # if HAVE_STDINT_H # include <stdint.h> # endif -# if HAVE_UNISTD_H -# include <unistd.h> -# endif +# include <unistd.h> /* 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 82dec8d90..0673d80fc 100644 --- a/lib/idcache.c +++ b/lib/idcache.c @@ -27,9 +27,7 @@ #include <pwd.h> #include <grp.h> -#if HAVE_UNISTD_H -# include <unistd.h> -#endif +#include <unistd.h> #include "xalloc.h" diff --git a/lib/mkdir-p.c b/lib/mkdir-p.c index 962f452bd..315a3a06a 100644 --- a/lib/mkdir-p.c +++ b/lib/mkdir-p.c @@ -30,9 +30,7 @@ #include <stdio.h> #include <sys/types.h> #include <sys/stat.h> -#if HAVE_UNISTD_H -# include <unistd.h> -#endif +#include <unistd.h> #include <stdlib.h> #include <errno.h> diff --git a/lib/mountlist.c b/lib/mountlist.c index a8ef87d8c..da39daaef 100644 --- a/lib/mountlist.c +++ b/lib/mountlist.c @@ -37,9 +37,7 @@ char *strstr (); #include <fcntl.h> -#ifdef HAVE_UNISTD_H -# include <unistd.h> -#endif +#include <unistd.h> #if HAVE_SYS_PARAM_H # include <sys/param.h> diff --git a/lib/nanosleep.c b/lib/nanosleep.c index f41aed2cf..97d60d864 100644 --- a/lib/nanosleep.c +++ b/lib/nanosleep.c @@ -30,9 +30,7 @@ #include <errno.h> -#if HAVE_UNISTD_H -# include <unistd.h> -#endif +#include <unistd.h> #include "timespec.h" diff --git a/lib/pathmax.h b/lib/pathmax.h index 613c56c09..6941e457e 100644 --- a/lib/pathmax.h +++ b/lib/pathmax.h @@ -18,9 +18,7 @@ #ifndef _PATHMAX_H # define _PATHMAX_H -# if HAVE_UNISTD_H -# include <unistd.h> -# endif +# include <unistd.h> # include <limits.h> diff --git a/lib/physmem.c b/lib/physmem.c index dabb00ccb..99fc8465b 100644 --- a/lib/physmem.c +++ b/lib/physmem.c @@ -23,9 +23,7 @@ #include "physmem.h" -#if HAVE_UNISTD_H -# include <unistd.h> -#endif +#include <unistd.h> #if HAVE_SYS_PSTAT_H # include <sys/pstat.h> diff --git a/lib/posixver.c b/lib/posixver.c index 2fa097ae6..7fd7cd3b8 100644 --- a/lib/posixver.c +++ b/lib/posixver.c @@ -27,9 +27,7 @@ #include <limits.h> #include <stdlib.h> -#if HAVE_UNISTD_H -# include <unistd.h> -#endif +#include <unistd.h> #ifndef _POSIX2_VERSION # define _POSIX2_VERSION 0 #endif diff --git a/lib/putenv.c b/lib/putenv.c index 69fb90be6..0a23694fa 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 <string.h> -#if defined (__GNU_LIBRARY__) || defined (HAVE_UNISTD_H) -# include <unistd.h> -#endif +#include <unistd.h> #if HAVE_GNU_LD # define environ __environ diff --git a/lib/raise.c b/lib/raise.c index 8eeea5c89..1225f764e 100644 --- a/lib/raise.c +++ b/lib/raise.c @@ -21,9 +21,7 @@ #include <sys/types.h> #include <signal.h> -#if HAVE_UNISTD_H -# include <unistd.h> -#endif +#include <unistd.h> int raise (int sig) diff --git a/lib/safe-read.c b/lib/safe-read.c index 904fc71f0..a5108356d 100644 --- a/lib/safe-read.c +++ b/lib/safe-read.c @@ -30,9 +30,7 @@ /* Get ssize_t. */ #include <sys/types.h> -#if HAVE_UNISTD_H -# include <unistd.h> -#endif +#include <unistd.h> #include <errno.h> diff --git a/lib/same.c b/lib/same.c index 89ee47dd0..9cbf47a76 100644 --- a/lib/same.c +++ b/lib/same.c @@ -25,9 +25,7 @@ #include <stdbool.h> #include <stdio.h> -#ifdef HAVE_UNISTD_H -# include <unistd.h> -#endif +#include <unistd.h> #include <stdlib.h> #include <sys/types.h> #include <sys/stat.h> diff --git a/lib/save-cwd.c b/lib/save-cwd.c index 5ad790a4d..aefdb6e7e 100644 --- a/lib/save-cwd.c +++ b/lib/save-cwd.c @@ -29,9 +29,7 @@ #include <stdio.h> #include <stdlib.h> -#if HAVE_UNISTD_H -# include <unistd.h> -#endif +#include <unistd.h> #include <fcntl.h> diff --git a/lib/setenv.c b/lib/setenv.c index 33dbeb7a3..808820091 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 <stdlib.h> #include <string.h> -#if _LIBC || HAVE_UNISTD_H -# include <unistd.h> -#endif +#include <unistd.h> #if !_LIBC # include "allocsa.h" diff --git a/lib/settime.c b/lib/settime.c index 459d5436c..20edeab28 100644 --- a/lib/settime.c +++ b/lib/settime.c @@ -23,9 +23,7 @@ #include "timespec.h" -#if HAVE_UNISTD_H -# include <unistd.h> -#endif +#include <unistd.h> #include <errno.h> diff --git a/lib/tempname.c b/lib/tempname.c index 4b0fad3f8..27663c23c 100644 --- a/lib/tempname.c +++ b/lib/tempname.c @@ -60,9 +60,7 @@ # include <inttypes.h> #endif -#if HAVE_UNISTD_H || _LIBC -# include <unistd.h> -#endif +#include <unistd.h> #include <sys/stat.h> diff --git a/lib/unlinkdir.c b/lib/unlinkdir.c index b12d2a492..4d53fa02f 100644 --- a/lib/unlinkdir.c +++ b/lib/unlinkdir.c @@ -25,9 +25,7 @@ #if HAVE_PRIV_H # include <priv.h> #endif -#if HAVE_UNISTD_H -# include <unistd.h> -#endif +#include <unistd.h> #if ! UNLINK_CANNOT_UNLINK_DIR diff --git a/lib/unsetenv.c b/lib/unsetenv.c index 4b53fc9c8..d96389656 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 <stdlib.h> #include <string.h> -#if _LIBC || HAVE_UNISTD_H -# include <unistd.h> -#endif +#include <unistd.h> #if !_LIBC # define __environ environ diff --git a/lib/userspec.c b/lib/userspec.c index 5f5c5bf43..d09a6b212 100644 --- a/lib/userspec.c +++ b/lib/userspec.c @@ -39,9 +39,7 @@ #include <stdlib.h> #include <string.h> -#if HAVE_UNISTD_H -# include <unistd.h> -#endif +#include <unistd.h> #include "intprops.h" #include "inttostr.h" diff --git a/lib/xgethostname.c b/lib/xgethostname.c index 5b8b9b2e8..2facf9b1d 100644 --- a/lib/xgethostname.c +++ b/lib/xgethostname.c @@ -29,9 +29,7 @@ #include <stdlib.h> #include <errno.h> -#if HAVE_UNISTD_H -# include <unistd.h> -#endif +#include <unistd.h> #include "xalloc.h" diff --git a/lib/xreadlink.c b/lib/xreadlink.c index d56d2a6af..63f5ce1bf 100644 --- a/lib/xreadlink.c +++ b/lib/xreadlink.c @@ -30,9 +30,7 @@ #include <limits.h> #include <sys/types.h> #include <stdlib.h> -#if HAVE_UNISTD_H -# include <unistd.h> -#endif +#include <unistd.h> #ifndef SIZE_MAX # define SIZE_MAX ((size_t) -1) |