summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2006-03-08 01:37:15 +0000
committerPaul Eggert <eggert@cs.ucla.edu>2006-03-08 01:37:15 +0000
commit15a8db51a45e0e0fb7777c12ce983dcb29da245a (patch)
tree952db3f6f745ac2b61ecdb293f9c1d7ad9cadc91
parent645936535fa6199da5a9915578d57038646f7ed6 (diff)
downloadgnulib-15a8db51a45e0e0fb7777c12ce983dcb29da245a.tar.gz
* lib/c-stack.c: Include unistd.h unconditionally, since we now assume
the unistd module. * lib/getlogin_r.c: Likewise. * lib/getlogin_r.h: Likewise. * lib/glob.c: Likewise. * lib/pagealign_alloc.c: Likewise. * lib/unistd_.h: Remove; no longer needed. * modules/c-stack (Depends-on): Add unistd. * modules/getlogin_r: Likewise. * modules/glob: Likewise. * modules/pagealign_alloc: Likewise. * modules/unistd (Files): Remove lib/unistd_.h. (EXTRA_DIST): Remove. (unistd.h): Create using 'echo' rather than 'cp', so that we don't need unistd_.h. (MOSTLYCLEANFILES): Remove unistd.h-t.
-rw-r--r--ChangeLog12
-rw-r--r--lib/ChangeLog10
-rw-r--r--lib/c-stack.c6
-rw-r--r--lib/getlogin_r.c5
-rw-r--r--lib/getlogin_r.h5
-rw-r--r--lib/glob.c11
-rw-r--r--lib/pagealign_alloc.c5
-rw-r--r--lib/unistd_.h24
-rw-r--r--modules/c-stack1
-rw-r--r--modules/getlogin_r1
-rw-r--r--modules/glob1
-rw-r--r--modules/pagealign_alloc1
-rw-r--r--modules/unistd15
13 files changed, 41 insertions, 56 deletions
diff --git a/ChangeLog b/ChangeLog
index ecdc2146e6..163105e108 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2006-03-07 Paul Eggert <eggert@cs.ucla.edu>
+
+ * modules/c-stack (Depends-on): Add unistd.
+ * modules/getlogin_r: Likewise.
+ * modules/glob: Likewise.
+ * modules/pagealign_alloc: Likewise.
+ * modules/unistd (Files): Remove lib/unistd_.h.
+ (EXTRA_DIST): Remove.
+ (unistd.h): Create using 'echo' rather than 'cp', so that we don't
+ need unistd_.h.
+ (MOSTLYCLEANFILES): Remove unistd.h-t.
+
2006-03-07 Simon Josefsson <jas@extundo.com>
* modules/getopt (Depends-on): Add unistd.
diff --git a/lib/ChangeLog b/lib/ChangeLog
index b5cc5b1aca..6ab7de94d3 100644
--- a/lib/ChangeLog
+++ b/lib/ChangeLog
@@ -1,3 +1,13 @@
+2006-03-07 Paul Eggert <eggert@cs.ucla.edu>
+
+ * c-stack.c: Include unistd.h unconditionally, since we now assume
+ the unistd module.
+ * getlogin_r.c: Likewise.
+ * getlogin_r.h: Likewise.
+ * glob.c: Likewise.
+ * pagealign_alloc.c: Likewise.
+ * unistd_.h: Remove; no longer needed.
+
2006-03-07 Simon Josefsson <jas@extundo.com>
* unistd_.h: New file.
diff --git a/lib/c-stack.c b/lib/c-stack.c
index 32088f9c6d..b4c32651d1 100644
--- a/lib/c-stack.c
+++ b/lib/c-stack.c
@@ -1,6 +1,6 @@
/* Stack overflow handling.
- Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2004, 2006 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
@@ -77,9 +77,7 @@ typedef struct sigaltstack stack_t;
# include <ucontext.h>
#endif
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#endif
+#include <unistd.h>
#ifndef STDERR_FILENO
# define STDERR_FILENO 2
#endif
diff --git a/lib/getlogin_r.c b/lib/getlogin_r.c
index b9b76c64b2..371164a51d 100644
--- a/lib/getlogin_r.c
+++ b/lib/getlogin_r.c
@@ -26,10 +26,7 @@
#include <errno.h>
#include <string.h>
-
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#endif
+#include <unistd.h>
#if !HAVE_DECL_GETLOGIN
char *getlogin (void);
diff --git a/lib/getlogin_r.h b/lib/getlogin_r.h
index 3ff3cafa69..3b304acda1 100644
--- a/lib/getlogin_r.h
+++ b/lib/getlogin_r.h
@@ -19,10 +19,7 @@
/* Written by Paul Eggert and Derek Price. */
#include <stddef.h>
-
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#endif
+#include <unistd.h>
/* Copies the user's login name to NAME.
The array pointed to by NAME has room for SIZE bytes.
diff --git a/lib/glob.c b/lib/glob.c
index fe0e8d58fe..265377e799 100644
--- a/lib/glob.c
+++ b/lib/glob.c
@@ -34,13 +34,10 @@
#include <stdio.h> /* Needed on stupid SunOS for assert. */
#if !defined _LIBC || !defined GLOB_ONLY_P
-#if defined HAVE_UNISTD_H || defined _LIBC
-# include <unistd.h>
-# ifndef POSIX
-# ifdef _POSIX_VERSION
-# define POSIX
-# endif
-# endif
+
+#include <unistd.h>
+#if !defined POSIX && defined _POSIX_VERSION
+# define POSIX
#endif
#include <pwd.h>
diff --git a/lib/pagealign_alloc.c b/lib/pagealign_alloc.c
index 28e8209f71..45bbd65732 100644
--- a/lib/pagealign_alloc.c
+++ b/lib/pagealign_alloc.c
@@ -29,10 +29,7 @@
#include <stdlib.h>
#include <fcntl.h>
-
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#endif
+#include <unistd.h>
#if HAVE_MMAP
# include <sys/mman.h>
diff --git a/lib/unistd_.h b/lib/unistd_.h
deleted file mode 100644
index 484bd36a71..0000000000
--- a/lib/unistd_.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/* A unistd.h replacement for systems lacking it.
- Copyright (C) 2006 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
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
- USA. */
-
-/* Put any statements that are necessary to get a working unistd.h in
- this file. */
-
-/* MS Visual Studio doesn't have unistd.h, but it doesn't seem to need
- any particular statements in this file. So this file is here to
- avoid breaking '#include <unistd.h>' in other files. */
diff --git a/modules/c-stack b/modules/c-stack
index 03e97a5fb6..926aaf7aea 100644
--- a/modules/c-stack
+++ b/modules/c-stack
@@ -9,6 +9,7 @@ m4/c-stack.m4
Depends-on:
gettext-h
exitfail
+unistd
configure.ac:
gl_C_STACK
diff --git a/modules/getlogin_r b/modules/getlogin_r
index c10863548a..fc21faf735 100644
--- a/modules/getlogin_r
+++ b/modules/getlogin_r
@@ -7,6 +7,7 @@ lib/getlogin_r.c
m4/getlogin_r.m4
Depends-on:
+unistd
configure.ac:
gl_GETLOGIN_R
diff --git a/modules/glob b/modules/glob
index 98611a8784..6537f178df 100644
--- a/modules/glob
+++ b/modules/glob
@@ -19,6 +19,7 @@ restrict
stat-macros
stdbool
strdup
+unistd
configure.ac:
gl_GLOB
diff --git a/modules/pagealign_alloc b/modules/pagealign_alloc
index acb9abee68..78e6d708cb 100644
--- a/modules/pagealign_alloc
+++ b/modules/pagealign_alloc
@@ -13,6 +13,7 @@ exit
getpagesize
gettext-h
xalloc
+unistd
configure.ac:
gl_PAGEALIGN_ALLOC
diff --git a/modules/unistd b/modules/unistd
index 6cb126a55d..f54499f119 100644
--- a/modules/unistd
+++ b/modules/unistd
@@ -2,7 +2,6 @@ Description:
A <unistd.h> for systems lacking it.
Files:
-lib/unistd_.h
m4/unistd_h.m4
Depends-on:
@@ -12,14 +11,12 @@ gl_HEADER_UNISTD
Makefile.am:
BUILT_SOURCES += $(UNISTD_H)
-EXTRA_DIST += unistd_.h
-
-# We need the following in order to create <unistd.h> when the system
-# doesn't have one.
-unistd.h: unistd_.h
- cp $(srcdir)/unistd_.h $@-t
- mv $@-t $@
-MOSTLYCLEANFILES += unistd.h unistd.h-t
+
+# We need the following in order to create an empty placeholder for
+# <unistd.h> when the system doesn't have one.
+unistd.h:
+ echo '/* Empty placeholder for $@. */' >$@
+MOSTLYCLEANFILES += unistd.h
Include:
#include <unistd.h>