summaryrefslogtreecommitdiffstats
path: root/openbsd-compat/bsd-cygwin_util.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2001-02-18 02:30:55 +0100
committerDamien Miller <djm@mindrot.org>2001-02-18 02:30:55 +0100
commit2deb3f64f60d5fe0331f87416d99536b220d7a4f (patch)
tree1d5e69bd29c83bd339c14b970d1189843260f2ba /openbsd-compat/bsd-cygwin_util.c
parentKNF (diff)
downloadopenssh-2deb3f64f60d5fe0331f87416d99536b220d7a4f.tar.xz
openssh-2deb3f64f60d5fe0331f87416d99536b220d7a4f.zip
- (djm) Fix my breaking of cygwin builds, Patch from Corinna Vinschen
<vinschen@redhat.com> and myself.
Diffstat (limited to 'openbsd-compat/bsd-cygwin_util.c')
-rw-r--r--openbsd-compat/bsd-cygwin_util.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/openbsd-compat/bsd-cygwin_util.c b/openbsd-compat/bsd-cygwin_util.c
index 2dcb35521..ea981be50 100644
--- a/openbsd-compat/bsd-cygwin_util.c
+++ b/openbsd-compat/bsd-cygwin_util.c
@@ -15,7 +15,7 @@
#include "includes.h"
-RCSID("$Id: bsd-cygwin_util.c,v 1.2 2001/02/09 01:55:36 djm Exp $");
+RCSID("$Id: bsd-cygwin_util.c,v 1.3 2001/02/18 01:30:56 djm Exp $");
#ifdef HAVE_CYGWIN
@@ -26,8 +26,21 @@ RCSID("$Id: bsd-cygwin_util.c,v 1.2 2001/02/09 01:55:36 djm Exp $");
#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);
}