changeset 16522:982859eb1700

termios: fix pid_t always, not just for tcgetsid 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>
author Eric Blake <eblake@redhat.com>
date Wed, 29 Feb 2012 08:36:22 -0700
parents bceff178bb99
children 3b943bd9baaf
files ChangeLog doc/posix-headers/termios.texi lib/termios.in.h
diffstat 3 files changed, 11 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- 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'.
--- a/doc/posix-headers/termios.texi
+++ b/doc/posix-headers/termios.texi
@@ -10,6 +10,9 @@
 @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:
--- a/lib/termios.in.h
+++ b/lib/termios.in.h
@@ -32,12 +32,6 @@
 }
 #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 @@
 #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.  */