changeset 15519:5b310380e54f

pipe2: silence compiler warning Detected when testing pipe2 in isolation on mingw. The fail: label needs either gnulib O_NONBLOCK emulation, or non-Windows systems. * lib/pipe2.c (pipe2): Hide label if it is not used. Signed-off-by: Eric Blake <eblake@redhat.com>
author Eric Blake <eblake@redhat.com>
date Wed, 17 Aug 2011 14:35:00 -0600
parents 72c48e34ac0a
children 8d4beb5eae92
files ChangeLog lib/pipe2.c
diffstat 2 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2011-08-17  Eric Blake  <eblake@redhat.com>
+
+	pipe2: silence compiler warning
+	* lib/pipe2.c (pipe2): Hide label if it is not used.
+
 2011-08-15  Ben Pfaff  <blp@cs.stanford.edu>
 
 	relocatable-prog: fix link error
--- a/lib/pipe2.c
+++ b/lib/pipe2.c
@@ -151,6 +151,8 @@
 
 #endif
 
+#if GNULIB_defined_O_NONBLOCK || \
+  !((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)
  fail:
   {
     int saved_errno = errno;
@@ -161,4 +163,5 @@
     errno = saved_errno;
     return -1;
   }
+#endif
 }