termios: fix pid_t always, not just for tcgetsid
authorEric Blake <eblake@redhat.com>
Wed, 29 Feb 2012 15:36:22 +0000 (08:36 -0700)
committerEric Blake <eblake@redhat.com>
Wed, 29 Feb 2012 15:36:22 +0000 (08:36 -0700)
tests-termios.c was failing on more than just cygwin.

* doc/posix-headers/termios.texi (termios.h): Mention problem.
* lib/termios.in.h (include): Ensure pid_t on all platforms, not
just when building tcgetsid.

Signed-off-by: Eric Blake <eblake@redhat.com>
ChangeLog
doc/posix-headers/termios.texi
lib/termios.in.h

index f524a5a..ddc7b54 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2012-02-29  Eric Blake  <eblake@redhat.com>
+
+       termios: fix pid_t always, not just for tcgetsid
+       * doc/posix-headers/termios.texi (termios.h): Mention problem.
+       * lib/termios.in.h (include): Ensure pid_t on all platforms, not
+       just when building tcgetsid.
+
 2012-02-29  Bruno Haible  <bruno@clisp.org>
 
        Tests for module 'hypotl'.
index 11d4d99..504743d 100644 (file)
@@ -10,6 +10,9 @@ Portability problems fixed by Gnulib:
 @item
 This header file is missing on some platforms:
 mingw, MSVC 9.
+@item
+This header does not declare @code{pid_t} on all platforms:
+glibc on some architectures, FreeBSD 6.4, OpenBSD 4.9, Cygwin 1.7.11.
 @end itemize
 
 Portability problems not fixed by Gnulib:
index 3836e2d..f8a3b73 100644 (file)
@@ -32,12 +32,6 @@ extern "C" {
 }
 #endif
 
-/* On Cygwin 1.7.11, tcgetsid returns int instead of pid_t; at least
-   they are the same size on that platform.  */
-#ifdef __CYGWIN__
-# include <sys/types.h>
-#endif
-
 /* The include_next requires a split double-inclusion guard.  */
 #if @HAVE_TERMIOS_H@
 # @INCLUDE_NEXT@ @NEXT_TERMIOS_H@
@@ -46,10 +40,8 @@ extern "C" {
 #ifndef _@GUARD_PREFIX@_TERMIOS_H
 #define _@GUARD_PREFIX@_TERMIOS_H
 
-#if @GNULIB_TCGETSID@
 /* Get pid_t.  */
-# include <sys/types.h>
-#endif
+#include <sys/types.h>
 
 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */