[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] tcgetsid: fix cygwin header bug
From: |
Eric Blake |
Subject: |
Re: [PATCH] tcgetsid: fix cygwin header bug |
Date: |
Wed, 29 Feb 2012 08:36:19 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:10.0.1) Gecko/20120216 Thunderbird/10.0.1 |
On 02/29/2012 08:04 AM, Bruno Haible wrote:
> Eric Blake wrote:
>> I guess I was seeing the failure in a project that included termios.h
>> but did not pull in the tcgetsid module.
>
> Indeed, with a testdir for just the 'termios' module, I'm getting a
> compilation failure in tests/test-termios.c on
> glibc HP-PA, IA64, PowerPC, SPARC
glibc has this bug too?
> FreeBSD 6.4
> OpenBSD 4.9
I'll add those to my list in the docs.
> but not on Cygwin 1.7.9. Does it fail on Cygwin 1.7.10? In any case,
> the "#include <sys/types.h>" in gnulib/lib/termios.in.h should not be
> limited to Cygwin.
Here's what I'm pushing.
diff --git i/ChangeLog w/ChangeLog
index f524a5a..ddc7b54 100644
--- i/ChangeLog
+++ w/ChangeLog
@@ -1,3 +1,10 @@
+2012-02-29 Eric Blake <address@hidden>
+
+ 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 <address@hidden>
Tests for module 'hypotl'.
diff --git i/doc/posix-headers/termios.texi w/doc/posix-headers/termios.texi
index 11d4d99..504743d 100644
--- i/doc/posix-headers/termios.texi
+++ w/doc/posix-headers/termios.texi
@@ -10,6 +10,9 @@ termios.h
@item
This header file is missing on some platforms:
mingw, MSVC 9.
address@hidden
+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:
diff --git i/lib/termios.in.h w/lib/termios.in.h
index 3836e2d..f8a3b73 100644
--- i/lib/termios.in.h
+++ w/lib/termios.in.h
@@ -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 address@hidden@_TERMIOS_H
#define address@hidden@_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. */
--
Eric Blake address@hidden +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature