summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gl/Makefile.am13
-rw-r--r--gl/close.c2
-rw-r--r--gl/inet_ntop.c6
-rw-r--r--gl/inet_pton.c6
-rw-r--r--gl/m4/sys_stat_h.m45
-rw-r--r--gl/sys_stat.in.h4
-rw-r--r--gl/tests/Makefile.am2
-rw-r--r--gl/unistd.in.h16
-rw-r--r--lib/gl/Makefile.am5
-rw-r--r--lib/gl/m4/sys_stat_h.m45
-rw-r--r--lib/gl/sys_stat.in.h4
-rw-r--r--lib/gl/unistd.in.h16
-rw-r--r--maint.mk4
13 files changed, 40 insertions, 48 deletions
diff --git a/gl/Makefile.am b/gl/Makefile.am
index 01cf02beae..22965405bc 100644
--- a/gl/Makefile.am
+++ b/gl/Makefile.am
@@ -91,7 +91,7 @@ BUILT_SOURCES += $(ARPA_INET_H)
# We need the following in order to create <arpa/inet.h> when the system
# doesn't have one.
arpa/inet.h: arpa_inet.in.h
- $(AM_V_at)@MKDIR_P@ arpa
+ $(AM_V_at)$(MKDIR_P) arpa
$(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
@@ -418,7 +418,7 @@ BUILT_SOURCES += $(NETINET_IN_H)
# We need the following in order to create <netinet/in.h> when the system
# doesn't have one.
netinet/in.h: netinet_in.in.h
- $(AM_V_at)@MKDIR_P@ netinet
+ $(AM_V_at)$(MKDIR_P) netinet
$(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
@@ -917,7 +917,7 @@ BUILT_SOURCES += $(SYS_SELECT_H)
# We need the following in order to create <sys/select.h> when the system
# doesn't have one that works with the given compiler.
sys/select.h: sys_select.in.h
- $(AM_V_at)@MKDIR_P@ sys
+ $(AM_V_at)$(MKDIR_P) sys
$(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
@@ -945,7 +945,7 @@ BUILT_SOURCES += $(SYS_SOCKET_H)
# We need the following in order to create <sys/socket.h> when the system
# doesn't have one that works with the given compiler.
sys/socket.h: sys_socket.in.h
- $(AM_V_at)@MKDIR_P@ sys
+ $(AM_V_at)$(MKDIR_P) sys
$(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
@@ -991,7 +991,7 @@ BUILT_SOURCES += $(SYS_STAT_H)
# We need the following in order to create <sys/stat.h> when the system
# has one that is incomplete.
sys/stat.h: sys_stat.in.h
- $(AM_V_at)@MKDIR_P@ sys
+ $(AM_V_at)$(MKDIR_P) sys
$(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
@@ -1003,6 +1003,7 @@ sys/stat.h: sys_stat.in.h
-e 's|@''HAVE_LSTAT''@|$(HAVE_LSTAT)|g' \
-e 's|@''REPLACE_LSTAT''@|$(REPLACE_LSTAT)|g' \
-e 's|@''REPLACE_MKDIR''@|$(REPLACE_MKDIR)|g' \
+ -e 's|@''REPLACE_FCHDIR''@|$(REPLACE_FCHDIR)|g' \
-e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
< $(srcdir)/sys_stat.in.h; \
} > $@-t && \
@@ -1021,7 +1022,7 @@ BUILT_SOURCES += $(SYS_TIME_H)
# We need the following in order to create <sys/time.h> when the system
# doesn't have one that works with the given compiler.
sys/time.h: sys_time.in.h
- $(AM_V_at)@MKDIR_P@ sys
+ $(AM_V_at)$(MKDIR_P) sys
$(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
sed -e 's/@''HAVE_SYS_TIME_H''@/$(HAVE_SYS_TIME_H)/g' \
diff --git a/gl/close.c b/gl/close.c
index 0e56dcb27f..5278f24bba 100644
--- a/gl/close.c
+++ b/gl/close.c
@@ -33,7 +33,7 @@ rpl_close (int fd)
int retval = close (fd);
#endif
-#ifdef FCHDIR_REPLACEMENT
+#if REPLACE_FCHDIR
if (retval >= 0)
_gl_unregister_fd (fd);
#endif
diff --git a/gl/inet_ntop.c b/gl/inet_ntop.c
index be091ff913..c32c273054 100644
--- a/gl/inet_ntop.c
+++ b/gl/inet_ntop.c
@@ -1,6 +1,6 @@
/* inet_ntop.c -- convert IPv4 and IPv6 addresses from binary to text form
- Copyright (C) 2005, 2006, 2008 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006, 2008, 2009 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
@@ -42,10 +42,6 @@
#include <string.h>
#include <errno.h>
-#ifndef EAFNOSUPPORT
-# define EAFNOSUPPORT EINVAL
-#endif
-
#define NS_IN6ADDRSZ 16
#define NS_INT16SZ 2
diff --git a/gl/inet_pton.c b/gl/inet_pton.c
index 62ef145950..a9c9bafdef 100644
--- a/gl/inet_pton.c
+++ b/gl/inet_pton.c
@@ -1,6 +1,6 @@
/* inet_pton.c -- convert IPv4 and IPv6 addresses from text to binary form
- Copyright (C) 2006, 2008 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2008, 2009 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
@@ -41,10 +41,6 @@
#include <string.h>
#include <errno.h>
-#ifndef EAFNOSUPPORT
-# define EAFNOSUPPORT EINVAL
-#endif
-
#define NS_INADDRSZ 4
#define NS_IN6ADDRSZ 16
#define NS_INT16SZ 2
diff --git a/gl/m4/sys_stat_h.m4 b/gl/m4/sys_stat_h.m4
index 20c82edf93..5113e55380 100644
--- a/gl/m4/sys_stat_h.m4
+++ b/gl/m4/sys_stat_h.m4
@@ -1,5 +1,5 @@
-# sys_stat_h.m4 serial 10 -*- Autoconf -*-
-dnl Copyright (C) 2006-2008 Free Software Foundation, Inc.
+# sys_stat_h.m4 serial 11 -*- Autoconf -*-
+dnl Copyright (C) 2006-2009 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -50,6 +50,7 @@ AC_DEFUN([gl_SYS_STAT_MODULE_INDICATOR],
AC_DEFUN([gl_SYS_STAT_H_DEFAULTS],
[
+ AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) dnl for REPLACE_FCHDIR
GNULIB_LCHMOD=0; AC_SUBST([GNULIB_LCHMOD])
GNULIB_LSTAT=0; AC_SUBST([GNULIB_LSTAT])
dnl Assume proper GNU behavior unless another module says otherwise.
diff --git a/gl/sys_stat.in.h b/gl/sys_stat.in.h
index 1e6294da89..d5392c6cfc 100644
--- a/gl/sys_stat.in.h
+++ b/gl/sys_stat.in.h
@@ -302,6 +302,10 @@ extern int rpl_lstat (const char *name, struct stat *buf);
lstat (p, b))
#endif
+#if @REPLACE_FCHDIR@
+# define fstat rpl_fstat
+extern int fstat (int fd, struct stat *buf);
+#endif
#if @REPLACE_MKDIR@
# undef mkdir
diff --git a/gl/tests/Makefile.am b/gl/tests/Makefile.am
index cf3647f9f4..8867a8177a 100644
--- a/gl/tests/Makefile.am
+++ b/gl/tests/Makefile.am
@@ -304,7 +304,7 @@ BUILT_SOURCES += $(SYS_IOCTL_H)
# We need the following in order to create <sys/ioctl.h> when the system
# does not have a complete one.
sys/ioctl.h: sys_ioctl.in.h
- $(AM_V_at)@MKDIR_P@ sys
+ $(AM_V_at)$(MKDIR_P) sys
$(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
sed -e 's|@''HAVE_SYS_IOCTL_H''@|$(HAVE_SYS_IOCTL_H)|g' \
diff --git a/gl/unistd.in.h b/gl/unistd.in.h
index f61dc65f14..1abcf83e5e 100644
--- a/gl/unistd.in.h
+++ b/gl/unistd.in.h
@@ -248,11 +248,11 @@ extern int fchdir (int /*fd*/);
# define dup rpl_dup
extern int dup (int);
-# if @REPLACE_DUP2@
-# undef dup2
-# endif
-# define dup2 rpl_dup2_fchdir
-extern int dup2 (int, int);
+/* Gnulib internal hooks needed to maintain the fchdir metadata. */
+extern int _gl_register_fd (int fd, const char *filename);
+extern void _gl_unregister_fd (int fd);
+extern int _gl_register_dup (int oldfd, int newfd);
+extern const char *_gl_directory_name (int fd);
# endif
#elif defined GNULIB_POSIXCHECK
@@ -621,12 +621,6 @@ extern ssize_t write (int fd, const void *buf, size_t count);
#endif
-#ifdef FCHDIR_REPLACEMENT
-/* gnulib internal function. */
-extern void _gl_unregister_fd (int fd);
-#endif
-
-
#ifdef __cplusplus
}
#endif
diff --git a/lib/gl/Makefile.am b/lib/gl/Makefile.am
index c5f48d65bb..ff97cc3544 100644
--- a/lib/gl/Makefile.am
+++ b/lib/gl/Makefile.am
@@ -669,7 +669,7 @@ BUILT_SOURCES += $(SYS_SOCKET_H)
# We need the following in order to create <sys/socket.h> when the system
# doesn't have one that works with the given compiler.
sys/socket.h: sys_socket.in.h
- $(AM_V_at)@MKDIR_P@ sys
+ $(AM_V_at)$(MKDIR_P) sys
$(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
@@ -715,7 +715,7 @@ BUILT_SOURCES += $(SYS_STAT_H)
# We need the following in order to create <sys/stat.h> when the system
# has one that is incomplete.
sys/stat.h: sys_stat.in.h
- $(AM_V_at)@MKDIR_P@ sys
+ $(AM_V_at)$(MKDIR_P) sys
$(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
@@ -727,6 +727,7 @@ sys/stat.h: sys_stat.in.h
-e 's|@''HAVE_LSTAT''@|$(HAVE_LSTAT)|g' \
-e 's|@''REPLACE_LSTAT''@|$(REPLACE_LSTAT)|g' \
-e 's|@''REPLACE_MKDIR''@|$(REPLACE_MKDIR)|g' \
+ -e 's|@''REPLACE_FCHDIR''@|$(REPLACE_FCHDIR)|g' \
-e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
< $(srcdir)/sys_stat.in.h; \
} > $@-t && \
diff --git a/lib/gl/m4/sys_stat_h.m4 b/lib/gl/m4/sys_stat_h.m4
index 20c82edf93..5113e55380 100644
--- a/lib/gl/m4/sys_stat_h.m4
+++ b/lib/gl/m4/sys_stat_h.m4
@@ -1,5 +1,5 @@
-# sys_stat_h.m4 serial 10 -*- Autoconf -*-
-dnl Copyright (C) 2006-2008 Free Software Foundation, Inc.
+# sys_stat_h.m4 serial 11 -*- Autoconf -*-
+dnl Copyright (C) 2006-2009 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -50,6 +50,7 @@ AC_DEFUN([gl_SYS_STAT_MODULE_INDICATOR],
AC_DEFUN([gl_SYS_STAT_H_DEFAULTS],
[
+ AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) dnl for REPLACE_FCHDIR
GNULIB_LCHMOD=0; AC_SUBST([GNULIB_LCHMOD])
GNULIB_LSTAT=0; AC_SUBST([GNULIB_LSTAT])
dnl Assume proper GNU behavior unless another module says otherwise.
diff --git a/lib/gl/sys_stat.in.h b/lib/gl/sys_stat.in.h
index c20df22bd1..e8b0c84cee 100644
--- a/lib/gl/sys_stat.in.h
+++ b/lib/gl/sys_stat.in.h
@@ -302,6 +302,10 @@ extern int rpl_lstat (const char *name, struct stat *buf);
lstat (p, b))
#endif
+#if @REPLACE_FCHDIR@
+# define fstat rpl_fstat
+extern int fstat (int fd, struct stat *buf);
+#endif
#if @REPLACE_MKDIR@
# undef mkdir
diff --git a/lib/gl/unistd.in.h b/lib/gl/unistd.in.h
index a259483292..9730aff4b5 100644
--- a/lib/gl/unistd.in.h
+++ b/lib/gl/unistd.in.h
@@ -248,11 +248,11 @@ extern int fchdir (int /*fd*/);
# define dup rpl_dup
extern int dup (int);
-# if @REPLACE_DUP2@
-# undef dup2
-# endif
-# define dup2 rpl_dup2_fchdir
-extern int dup2 (int, int);
+/* Gnulib internal hooks needed to maintain the fchdir metadata. */
+extern int _gl_register_fd (int fd, const char *filename);
+extern void _gl_unregister_fd (int fd);
+extern int _gl_register_dup (int oldfd, int newfd);
+extern const char *_gl_directory_name (int fd);
# endif
#elif defined GNULIB_POSIXCHECK
@@ -621,12 +621,6 @@ extern ssize_t write (int fd, const void *buf, size_t count);
#endif
-#ifdef FCHDIR_REPLACEMENT
-/* gnulib internal function. */
-extern void _gl_unregister_fd (int fd);
-#endif
-
-
#ifdef __cplusplus
}
#endif
diff --git a/maint.mk b/maint.mk
index 39bbc7698e..929d8c3bcd 100644
--- a/maint.mk
+++ b/maint.mk
@@ -74,8 +74,8 @@ export LC_ALL = C
_cfg_mk := $(shell test -f $(srcdir)/cfg.mk && echo '$(srcdir)/cfg.mk')
# Collect the names of rules starting with `sc_'.
-syntax-check-rules := $(shell sed -n 's/^\(sc_[a-zA-Z0-9_-]*\):.*/\1/p' \
- $(srcdir)/$(ME) $(_cfg_mk))
+syntax-check-rules := $(sort $(shell sed -n 's/^\(sc_[a-zA-Z0-9_-]*\):.*/\1/p' \
+ $(srcdir)/$(ME) $(_cfg_mk)))
.PHONY: $(syntax-check-rules)
local-checks-available = \