From: Frank Lichtenheld Date: Sat, 11 Nov 2023 08:18:08 +0000 (+0100) Subject: platform.c: Do not depend Windows build on HAVE_CHDIR X-Git-Tag: v2.7_alpha1~379 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=012ea92c414282488e3d60c87452849bde64aac4;p=thirdparty%2Fopenvpn.git platform.c: Do not depend Windows build on HAVE_CHDIR This broke in the CMake build since previously we just always set HAVE_CHDIR to 1 in the MSVC build. But actually the code should just not check HAVE_CHDIR on Windows. Github: fixes OpenVPN/openvpn#448 Change-Id: I0c78ce452135fe2c80275da449215ba926471018 Signed-off-by: Frank Lichtenheld Acked-by: Lev Stipakov Message-Id: <20231111081808.30967-1-gert@greenie.muc.de> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg27362.html Signed-off-by: Gert Doering --- diff --git a/src/openvpn/platform.c b/src/openvpn/platform.c index 32c4fe6be..62acabe22 100644 --- a/src/openvpn/platform.c +++ b/src/openvpn/platform.c @@ -392,7 +392,6 @@ platform_mlockall(bool print_msg) int platform_chdir(const char *dir) { -#ifdef HAVE_CHDIR #ifdef _WIN32 int res; struct gc_arena gc = gc_new(); @@ -400,11 +399,12 @@ platform_chdir(const char *dir) gc_free(&gc); return res; #else /* ifdef _WIN32 */ +#ifdef HAVE_CHDIR return chdir(dir); -#endif #else /* ifdef HAVE_CHDIR */ return -1; #endif +#endif } /*