OpenSSH 2.5.0p1

Corinna Vinschen vinschen at redhat.com
Sat Feb 17 19:01:22 EST 2001


On Sat, Feb 17, 2001 at 11:01:45AM +1100, Damien Miller wrote:
> On Sat, 17 Feb 2001, Corinna Vinschen wrote:
> 
> > Just got the latest from CVS. Damien has made a change to the
> > openbsd-compat/bsd-cygwin_util.c file which broke the Cygwin build.
> > You must not include bsd-cygwin_util.h in bsd-cygwin_util.c
> > because of the dangerous redefinitions of open and pipe.
> 
> Sorry!
> 
> Does this fix?
> [...]

It helps solving the define problem but it doesn't solve the
non matching definition and declaration of binary_open.

I have attached a new diff which includes your patch and
the patch changing the definition of binary_open.

Thanks,
Corinna

Index: bsd-cygwin_util.c
===================================================================
RCS file: /cvs/openssh_cvs/openbsd-compat/bsd-cygwin_util.c,v
retrieving revision 1.2
diff -u -p -r1.2 bsd-cygwin_util.c
--- bsd-cygwin_util.c	2001/02/09 01:55:36	1.2
+++ bsd-cygwin_util.c	2001/02/17 07:56:14
@@ -26,8 +26,21 @@ RCSID("$Id: bsd-cygwin_util.c,v 1.2 2001
 #include <windows.h>
 #define is_winnt       (GetVersion() < 0x80000000)
 
-int binary_open(const char *filename, int flags, mode_t mode)
+#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, ...)
 {
+	va_list ap;
+	mode_t mode;
+	
+	va_start(ap, flags);
+	mode = va_arg(ap, mode_t);
+	va_end(ap);
 	return open(filename, flags | O_BINARY, mode);
 }
 
Index: bsd-cygwin_util.h
===================================================================
RCS file: /cvs/openssh_cvs/openbsd-compat/bsd-cygwin_util.h,v
retrieving revision 1.2
diff -u -p -r1.2 bsd-cygwin_util.h
--- bsd-cygwin_util.h	2001/02/09 01:55:36	1.2
+++ bsd-cygwin_util.h	2001/02/17 07:56:14
@@ -15,7 +15,8 @@
 
 /* $Id: bsd-cygwin_util.h,v 1.2 2001/02/09 01:55:36 djm Exp $ */
 
-#include "config.h"
+#ifndef _BSD_CYGWIN_UTIL_H
+#define _BSD_CYGWIN_UTIL_H
 
 #ifdef HAVE_CYGWIN
 
@@ -28,3 +29,5 @@ int check_ntsec(const char *filename);
 #define pipe binary_pipe
 
 #endif /* HAVE_CYGWIN */
+
+#endif /* _BSD_CYGWIN_UTIL_H */





More information about the openssh-unix-dev mailing list