]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
do not use mode_t on Windows
authorHeiko Hund <heiko.hund@sophos.com>
Thu, 16 Feb 2012 17:30:39 +0000 (18:30 +0100)
committerDavid Sommerseth <davids@redhat.com>
Thu, 16 Feb 2012 18:36:27 +0000 (19:36 +0100)
The MSVC headers do not define mode_t. open() uses an int for
the permissions instead. Fixes building with the MSVC based
buildsystem.

Signed-off-by: Heiko Hund <heiko.hund@sophos.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Signed-off-by: David Sommerseth <davids@redhat.com>
misc.h
win32.c

diff --git a/misc.h b/misc.h
index 8c0bae1698c101f40acb8899246f04a382b09f93..e7a0b55e9817c02b0fa2bbb2d589911efaa6f45c 100644 (file)
--- a/misc.h
+++ b/misc.h
@@ -158,7 +158,7 @@ openvpn_fopen (const char *path, const char *mode)
 #endif
 
 #ifdef WIN32
-int openvpn_open (const char *path, int flags, mode_t mode);
+int openvpn_open (const char *path, int flags, int mode);
 #else
 static inline int
 openvpn_open (const char *path, int flags, mode_t mode)
diff --git a/win32.c b/win32.c
index 5b38918670015083bdce9a3305d9eb4aae73bd1d..a8f4ed9a6681a585a4c837aa48527462ca80120f 100644 (file)
--- a/win32.c
+++ b/win32.c
@@ -1064,7 +1064,7 @@ openvpn_fopen (const char *path, const char *mode)
 }
 
 int
-openvpn_open (const char *path, int flags, mode_t mode)
+openvpn_open (const char *path, int flags, int mode)
 {
   struct gc_arena gc = gc_new ();
   int fd = _wopen (wide_string (path, &gc), flags, mode);