bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Help with create_pipe_bidi


From: Eric Blake
Subject: Re: Help with create_pipe_bidi
Date: Sat, 18 Jul 2009 10:16:52 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.22) Gecko/20090605 Thunderbird/2.0.0.22 Mnenhy/0.7.6.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Bruno Haible on 7/18/2009 10:00 AM:
> Eric Blake wrote:
>> It is due to a bug in gnulib.
> 
> Yup. Thanks for committing the test and the fix.

The test is still buggy on mingw; here's a followup for the test to at
least let it compile, and I'm still investigating why the test fails on
mingw (but it looks like the problem is in:

156         orig_stdin = dup_noinherit (STDIN_FILENO);
(gdb) n
(null): _open_osfhandle failed: Bad file descriptor

when stdin is closed - dup_noinherit needs to silently ignore this failure).

> 
> Strange: On Linux, I don't see this failure. I see
> 
> $ m4-1.4.11 oops.m4 <&- >&-
> hi
> $ m4-1.4.12 oops.m4 <&- >&-
> hi
> $ m4-1.4.13 oops.m4 <&- >&-
> hi

I'll see if I can reproduce that, and if so, figure out why Linux was
happy when cygwin wasn't.

> I fixed a typo in the module description:

Thanks.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkph9XQACgkQ84KuGfSFAYBc9gCgm5Jxk44m6GA1jWgKxrY6fp4J
ALAAn2UaSwE5kV9JfMHE34CYrDOG3I2E
=yQAV
-----END PGP SIGNATURE-----
>From e17dd8c2585b615318549301e8a5491498bc8717 Mon Sep 17 00:00:00 2001
From: Eric Blake <address@hidden>
Date: Sat, 18 Jul 2009 09:10:05 -0600
Subject: [PATCH] test-pipe: fix mingw build

* tests/test-pipe.c (main): Avoid fcntl on mingw.

Signed-off-by: Eric Blake <address@hidden>
---
 ChangeLog         |    5 +++++
 tests/test-pipe.c |    6 ++++++
 2 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index dbafa7d..94adb9f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-07-18  Eric Blake  <address@hidden>
+
+       test-pipe: fix mingw build
+       * tests/test-pipe.c (main): Avoid fcntl on mingw.
+
 2009-07-18  Bruno Haible  <address@hidden>

        * modules/pipe-tests (Makefile.am): Fix typo.
diff --git a/tests/test-pipe.c b/tests/test-pipe.c
index 3018186..b5f70d0 100644
--- a/tests/test-pipe.c
+++ b/tests/test-pipe.c
@@ -131,7 +131,13 @@ main (int argc, const char *argv[])
         buffer[0]++;
         ASSERT (write (STDOUT_FILENO, buffer, 1) == 1);
         errno = 0;
+#ifdef F_GETFL
+        /* Try to keep stderr open for better diagnostics.  */
         i = fcntl (STDERR_FILENO, F_GETFL);
+#else
+        /* But allow compilation on mingw.  */
+        i = close (STDERR_FILENO);
+#endif
         if (test == 8)
           ASSERT (0 <= i);
         else
-- 
1.6.3.3.334.g916e1


reply via email to

[Prev in Thread] Current Thread [Next in Thread]