summaryrefslogtreecommitdiffstats
path: root/openbsd-compat
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2001-02-18 12:30:55 +1100
committerDamien Miller <djm@mindrot.org>2001-02-18 12:30:55 +1100
commit2deb3f64f60d5fe0331f87416d99536b220d7a4f (patch)
tree1d5e69bd29c83bd339c14b970d1189843260f2ba /openbsd-compat
parente74ebd03c23896f3f3d3f00cf5cc44c3f16c4c43 (diff)
- (djm) Fix my breaking of cygwin builds, Patch from Corinna Vinschen
<vinschen@redhat.com> and myself.
Diffstat (limited to 'openbsd-compat')
-rw-r--r--openbsd-compat/bsd-cygwin_util.c17
-rw-r--r--openbsd-compat/bsd-cygwin_util.h7
2 files changed, 20 insertions, 4 deletions
diff --git a/openbsd-compat/bsd-cygwin_util.c b/openbsd-compat/bsd-cygwin_util.c
index 2dcb3552..ea981be5 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);
}
diff --git a/openbsd-compat/bsd-cygwin_util.h b/openbsd-compat/bsd-cygwin_util.h
index b5d63cdc..e2d4b4da 100644
--- a/openbsd-compat/bsd-cygwin_util.h
+++ b/openbsd-compat/bsd-cygwin_util.h
@@ -13,9 +13,10 @@
* binary mode on Windows systems.
*/
-/* $Id: bsd-cygwin_util.h,v 1.2 2001/02/09 01:55:36 djm Exp $ */
+/* $Id: bsd-cygwin_util.h,v 1.3 2001/02/18 01:30:56 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 */