[PATCH] Cygwin: Avoid implicit declaration warnings

Corinna Vinschen vinschen at redhat.com
Fri Sep 1 19:10:56 EST 2006


Hi,

I have left this slip through already too long.  When compiling
openbsd-compat/bsd-cygwin_util.c, the following warnings appear:

  openbsd-compat/bsd-cygwin_util.c: In function `binary_open':
  openbsd-compat/bsd-cygwin_util.c:67: warning: implicit declaration of function `open'
  openbsd-compat/bsd-cygwin_util.c: In function `binary_pipe':
  openbsd-compat/bsd-cygwin_util.c:73: warning: implicit declaration of function `pipe'

The below patch fixes that.

Index: openbsd-compat/bsd-cygwin_util.c
===================================================================
RCS file: /cvs/openssh/openbsd-compat/bsd-cygwin_util.c,v
retrieving revision 1.18
diff -p -u -r1.18 bsd-cygwin_util.c
--- openbsd-compat/bsd-cygwin_util.c    5 Aug 2006 09:08:17 -0000       1.18
+++ openbsd-compat/bsd-cygwin_util.c    1 Sep 2006 08:42:22 -0000
@@ -31,6 +31,13 @@
 
 #ifdef HAVE_CYGWIN
 
+#if defined(open) && open == binary_open
+# undef open
+#endif
+#if defined(pipe) && open == binary_pipe
+# undef pipe
+#endif
+
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/utsname.h>
@@ -47,13 +54,6 @@
 #define ntsec_on(c)    ((c) && strstr((c),"ntsec") && !strstr((c),"nontsec"))
 #define ntsec_off(c)   ((c) && strstr((c),"nontsec"))
 #define ntea_on(c)     ((c) && strstr((c),"ntea") && !strstr((c),"nontea"))
-
-#if defined(open) && open == binary_open
-# undef open
-#endif
-#if defined(pipe) && open == binary_pipe
-# undef pipe
-#endif
 
 int 
 binary_open(const char *filename, int flags, ...)


Thanks,
Corinna

-- 
Corinna Vinschen
Cygwin Project Co-Leader
Red Hat



More information about the openssh-unix-dev mailing list