Merge remote-tracking branch 'origin/stable-2.0'
[bpt/guile.git] / lib / pipe2.c
index bb17264..12a5a8a 100644 (file)
@@ -1,5 +1,5 @@
 /* Create a pipe, with specific opening flags.
-   Copyright (C) 2009-2011 Free Software Foundation, Inc.
+   Copyright (C) 2009-2012 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
@@ -31,7 +31,7 @@
 #endif
 
 #if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
-/* Native Woe32 API.  */
+/* Native Windows API.  */
 
 # include <io.h>
 
@@ -75,7 +75,7 @@ pipe2 (int fd[2], int flags)
     }
 
 #if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
-/* Native Woe32 API.  */
+/* Native Windows API.  */
 
   if (_pipe (fd, 4096, flags & ~O_NONBLOCK) < 0)
     {
@@ -95,7 +95,9 @@ pipe2 (int fd[2], int flags)
         goto fail;
     }
 # else
-  verify (O_NONBLOCK == 0);
+  {
+    verify (O_NONBLOCK == 0);
+  }
 # endif
 
   return 0;
@@ -151,6 +153,8 @@ pipe2 (int fd[2], int flags)
 
 #endif
 
+#if GNULIB_defined_O_NONBLOCK || \
+  !((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)
  fail:
   {
     int saved_errno = errno;
@@ -161,4 +165,5 @@ pipe2 (int fd[2], int flags)
     errno = saved_errno;
     return -1;
   }
+#endif
 }