diff options
Diffstat (limited to 'openbsd-compat')
-rw-r--r-- | openbsd-compat/bsd-cygwin_util.c | 11 | ||||
-rw-r--r-- | openbsd-compat/bsd-cygwin_util.h | 17 |
2 files changed, 10 insertions, 18 deletions
diff --git a/openbsd-compat/bsd-cygwin_util.c b/openbsd-compat/bsd-cygwin_util.c index 6befc016f..d3d2d913a 100644 --- a/openbsd-compat/bsd-cygwin_util.c +++ b/openbsd-compat/bsd-cygwin_util.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) 2000, 2001, 2011 Corinna Vinschen <vinschen@redhat.com> | 2 | * Copyright (c) 2000, 2001, 2011, 2013 Corinna Vinschen <vinschen@redhat.com> |
3 | * | 3 | * |
4 | * Redistribution and use in source and binary forms, with or without | 4 | * Redistribution and use in source and binary forms, with or without |
5 | * modification, are permitted provided that the following conditions | 5 | * modification, are permitted provided that the following conditions |
@@ -27,20 +27,15 @@ | |||
27 | * binary mode on Windows systems. | 27 | * binary mode on Windows systems. |
28 | */ | 28 | */ |
29 | 29 | ||
30 | #define NO_BINARY_OPEN /* Avoid redefining open to binary_open for this file */ | ||
30 | #include "includes.h" | 31 | #include "includes.h" |
31 | 32 | ||
32 | #ifdef HAVE_CYGWIN | 33 | #ifdef HAVE_CYGWIN |
33 | 34 | ||
34 | #if defined(open) && open == binary_open | ||
35 | # undef open | ||
36 | #endif | ||
37 | |||
38 | #include <sys/types.h> | 35 | #include <sys/types.h> |
39 | |||
40 | #include <fcntl.h> | 36 | #include <fcntl.h> |
41 | #include <stdlib.h> | 37 | #include <string.h> |
42 | #include <unistd.h> | 38 | #include <unistd.h> |
43 | #include <windows.h> | ||
44 | 39 | ||
45 | #include "xmalloc.h" | 40 | #include "xmalloc.h" |
46 | 41 | ||
diff --git a/openbsd-compat/bsd-cygwin_util.h b/openbsd-compat/bsd-cygwin_util.h index b4bcd04b7..372e41955 100644 --- a/openbsd-compat/bsd-cygwin_util.h +++ b/openbsd-compat/bsd-cygwin_util.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* $Id: bsd-cygwin_util.h,v 1.15 2012/08/28 09:57:19 dtucker Exp $ */ | 1 | /* $Id: bsd-cygwin_util.h,v 1.16 2013/04/01 01:40:49 dtucker Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Copyright (c) 2000, 2001, 2011 Corinna Vinschen <vinschen@redhat.com> | 4 | * Copyright (c) 2000, 2001, 2011, 2013 Corinna Vinschen <vinschen@redhat.com> |
5 | * | 5 | * |
6 | * Redistribution and use in source and binary forms, with or without | 6 | * Redistribution and use in source and binary forms, with or without |
7 | * modification, are permitted provided that the following conditions | 7 | * modification, are permitted provided that the following conditions |
@@ -36,24 +36,21 @@ | |||
36 | 36 | ||
37 | #undef ERROR | 37 | #undef ERROR |
38 | 38 | ||
39 | #define WIN32_LEAN_AND_MEAN | 39 | /* Avoid including windows headers. */ |
40 | typedef void *HANDLE; | ||
41 | #define INVALID_HANDLE_VALUE ((HANDLE) -1) | ||
40 | 42 | ||
41 | #include <windows.h> | ||
42 | #include <sys/cygwin.h> | 43 | #include <sys/cygwin.h> |
43 | #include <io.h> | 44 | #include <io.h> |
44 | 45 | ||
45 | /* Make sure _WIN32 isn't defined later in the code, otherwise headers from | ||
46 | other packages might get the wrong idea about the target system. */ | ||
47 | #ifdef _WIN32 | ||
48 | #undef _WIN32 | ||
49 | #endif | ||
50 | |||
51 | int binary_open(const char *, int , ...); | 46 | int binary_open(const char *, int , ...); |
52 | int check_ntsec(const char *); | 47 | int check_ntsec(const char *); |
53 | char **fetch_windows_environment(void); | 48 | char **fetch_windows_environment(void); |
54 | void free_windows_environment(char **); | 49 | void free_windows_environment(char **); |
55 | 50 | ||
51 | #ifndef NO_BINARY_OPEN | ||
56 | #define open binary_open | 52 | #define open binary_open |
53 | #endif | ||
57 | 54 | ||
58 | #endif /* HAVE_CYGWIN */ | 55 | #endif /* HAVE_CYGWIN */ |
59 | 56 | ||