Update gnulib files.
authorSimon Josefsson <simon@josefsson.org>
Thu, 30 Sep 2010 15:28:55 +0000 (17:28 +0200)
committerSimon Josefsson <simon@josefsson.org>
Thu, 30 Sep 2010 15:28:55 +0000 (17:28 +0200)
NEWS
gl/Makefile.am
gl/m4/sys_wait_h.m4
gl/sys_wait.in.h

diff --git a/NEWS b/NEWS
index c6d6e03..6af3fa4 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,7 @@ GNU Libtasn1 NEWS                                     -*- outline -*-
 - tests: Link to gnulib to avoid build error related to 'rpl_ftello' on Solaris.
   Reported by Dagobert Michelsen.
 - doc: Fix bug reporting address to point at help-libtasn1@gnu.org.
+- build: Update gnulib files.
 
 * Noteworthy changes in release 2.8 (2010-09-25) [stable]
 - Update gnulib files.
index a89d909..574688f 100644 (file)
@@ -541,13 +541,16 @@ BUILT_SOURCES += sys/wait.h
 
 # We need the following in order to create <sys/wait.h> when the system
 # has one that is incomplete.
-sys/wait.h: sys_wait.in.h
+sys/wait.h: sys_wait.in.h $(CXXDEFS_H) $(WARN_ON_USE_H)
        $(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' \
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
              -e 's|@''NEXT_SYS_WAIT_H''@|$(NEXT_SYS_WAIT_H)|g' \
+             -e 's|@''GNULIB_WAITPID''@|$(GNULIB_WAITPID)|g' \
+             -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
              < $(srcdir)/sys_wait.in.h; \
        } > $@-t && \
        mv $@-t $@
index b0d23fa..63e1d21 100644 (file)
@@ -1,4 +1,4 @@
-# sys_wait_h.m4 serial 4
+# sys_wait_h.m4 serial 5
 dnl Copyright (C) 2008-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -10,6 +10,11 @@ AC_DEFUN([gl_SYS_WAIT_H],
 
   dnl <sys/wait.h> is always overridden, because of GNULIB_POSIXCHECK.
   gl_CHECK_NEXT_HEADERS([sys/wait.h])
+
+  dnl Check for declarations of anything we want to poison if the
+  dnl corresponding gnulib module is not in use.
+  gl_WARN_ON_USE_PREPARE([[#include <sys/wait.h>]],
+    [waitpid])
 ])
 
 AC_DEFUN([gl_SYS_WAIT_MODULE_INDICATOR],
@@ -17,9 +22,12 @@ AC_DEFUN([gl_SYS_WAIT_MODULE_INDICATOR],
   dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
   AC_REQUIRE([gl_SYS_WAIT_H_DEFAULTS])
   gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+  dnl Define it also as a C macro, for the benefit of the unit tests.
+  gl_MODULE_INDICATOR_FOR_TESTS([$1])
 ])
 
 AC_DEFUN([gl_SYS_WAIT_H_DEFAULTS],
 [
+  GNULIB_WAITPID=0; AC_SUBST([GNULIB_WAITPID])
   dnl Assume proper GNU behavior unless another module says otherwise.
 ])
index 009fa21..03a3b26 100644 (file)
 #ifndef _GL_SYS_WAIT_H
 #define _GL_SYS_WAIT_H
 
+/* Get pid_t.  */
+#include <sys/types.h>
+
+
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
+
+/* The definition of _GL_WARN_ON_USE is copied here.  */
+
+
 #if !((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)
 /* Unix API.  */
 
 #  define WEXITSTATUS(x) (((x) >> 8) & 0xff)
 # endif
 
+/* The stopping signal. Only to be accessed if WIFSTOPPED(x) is true.  */
+# ifndef WSTOPSIG
+#  define WSTOPSIG(x) (((x) >> 8) & 0x7f)
+# endif
+
 /* True if the process dumped core.  Not standardized by POSIX.  */
 # ifndef WCOREDUMP
 #  define WCOREDUMP(x) ((x) & 0x80)
 # endif
 
-# ifdef __cplusplus
-extern "C" {
-# endif
-
-/* Declarations of functions.  */
-
-# ifdef __cplusplus
-}
-# endif
-
 #else
 /* Native Windows API.  */
 
-# include <process.h>
-
-# define waitpid(pid,statusp,options) _cwait (statusp, pid, WAIT_CHILD)
+# include <signal.h> /* for SIGTERM */
 
 /* The following macros apply to an argument x, that is a status of a process,
    as returned by waitpid() or, equivalently, _cwait() or GetExitCodeProcess().
@@ -97,10 +99,37 @@ extern "C" {
 
 # define WEXITSTATUS(x) (x)
 
+/* There are no stopping signals.  */
+# define WSTOPSIG(x) 0
+
 /* There are no core dumps.  */
 # define WCOREDUMP(x) 0
 
 #endif
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Declarations of functions.  */
+
+#if @GNULIB_WAITPID@
+# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+_GL_FUNCDECL_SYS (waitpid, pid_t, (pid_t pid, int *statusp, int options));
+# endif
+_GL_CXXALIAS_SYS (waitpid, pid_t, (pid_t pid, int *statusp, int options));
+_GL_CXXALIASWARN (waitpid);
+#elif defined GNULIB_POSIXCHECK
+# undef waitpid
+# if HAVE_RAW_DECL_WAITPID
+_GL_WARN_ON_USE (waitpid, "waitpid is unportable - "
+                 "use gnulib module sys_wait for portability");
+# endif
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _GL_SYS_WAIT_H */
 #endif /* _GL_SYS_WAIT_H */