From: Eric Blake Date: Sat, 18 Jul 2009 15:10:05 +0000 (-0600) Subject: test-pipe: fix mingw build X-Git-Tag: v0.1~5771 X-Git-Url: http://erislabs.org.uk/gitweb/?a=commitdiff_plain;h=e17dd8c2585b615318549301e8a5491498bc8717;p=gnulib.git test-pipe: fix mingw build * tests/test-pipe.c (main): Avoid fcntl on mingw. Signed-off-by: Eric Blake --- diff --git a/ChangeLog b/ChangeLog index dbafa7dd7..94adb9f60 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-07-18 Eric Blake + + test-pipe: fix mingw build + * tests/test-pipe.c (main): Avoid fcntl on mingw. + 2009-07-18 Bruno Haible * modules/pipe-tests (Makefile.am): Fix typo. diff --git a/tests/test-pipe.c b/tests/test-pipe.c index 30181863f..b5f70d0ea 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