summaryrefslogtreecommitdiff
path: root/openbsd-compat/bsd-cygwin_util.c
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/bsd-cygwin_util.c
parente74ebd03c23896f3f3d3f00cf5cc44c3f16c4c43 (diff)
- (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 @@
15 15
16#include "includes.h" 16#include "includes.h"
17 17
18RCSID("$Id: bsd-cygwin_util.c,v 1.2 2001/02/09 01:55:36 djm Exp $"); 18RCSID("$Id: bsd-cygwin_util.c,v 1.3 2001/02/18 01:30:56 djm Exp $");
19 19
20#ifdef HAVE_CYGWIN 20#ifdef HAVE_CYGWIN
21 21
@@ -26,8 +26,21 @@ RCSID("$Id: bsd-cygwin_util.c,v 1.2 2001/02/09 01:55:36 djm Exp $");
26#include <windows.h> 26#include <windows.h>
27#define is_winnt (GetVersion() < 0x80000000) 27#define is_winnt (GetVersion() < 0x80000000)
28 28
29int binary_open(const char *filename, int flags, mode_t mode) 29#if defined(open) && open == binary_open
30# undef open
31#endif
32#if defined(pipe) && open == binary_pipe
33# undef pipe
34#endif
35
36int binary_open(const char *filename, int flags, ...)
30{ 37{
38 va_list ap;
39 mode_t mode;
40
41 va_start(ap, flags);
42 mode = va_arg(ap, mode_t);
43 va_end(ap);
31 return open(filename, flags | O_BINARY, mode); 44 return open(filename, flags | O_BINARY, mode);
32} 45}
33 46