diff options
Diffstat (limited to 'openbsd-compat')
-rw-r--r-- | openbsd-compat/bsd-cygwin_util.c | 17 | ||||
-rw-r--r-- | openbsd-compat/bsd-cygwin_util.h | 7 |
2 files changed, 20 insertions, 4 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 | ||
18 | RCSID("$Id: bsd-cygwin_util.c,v 1.2 2001/02/09 01:55:36 djm Exp $"); | 18 | RCSID("$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 | ||
29 | int 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 | |||
36 | int 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 | ||
diff --git a/openbsd-compat/bsd-cygwin_util.h b/openbsd-compat/bsd-cygwin_util.h index b5d63cdc7..e2d4b4dae 100644 --- a/openbsd-compat/bsd-cygwin_util.h +++ b/openbsd-compat/bsd-cygwin_util.h | |||
@@ -13,9 +13,10 @@ | |||
13 | * binary mode on Windows systems. | 13 | * binary mode on Windows systems. |
14 | */ | 14 | */ |
15 | 15 | ||
16 | /* $Id: bsd-cygwin_util.h,v 1.2 2001/02/09 01:55:36 djm Exp $ */ | 16 | /* $Id: bsd-cygwin_util.h,v 1.3 2001/02/18 01:30:56 djm Exp $ */ |
17 | 17 | ||
18 | #include "config.h" | 18 | #ifndef _BSD_CYGWIN_UTIL_H |
19 | #define _BSD_CYGWIN_UTIL_H | ||
19 | 20 | ||
20 | #ifdef HAVE_CYGWIN | 21 | #ifdef HAVE_CYGWIN |
21 | 22 | ||
@@ -28,3 +29,5 @@ int check_ntsec(const char *filename); | |||
28 | #define pipe binary_pipe | 29 | #define pipe binary_pipe |
29 | 30 | ||
30 | #endif /* HAVE_CYGWIN */ | 31 | #endif /* HAVE_CYGWIN */ |
32 | |||
33 | #endif /* _BSD_CYGWIN_UTIL_H */ | ||