From 012ea92c414282488e3d60c87452849bde64aac4 Mon Sep 17 00:00:00 2001 From: Frank Lichtenheld Date: Sat, 11 Nov 2023 09:18:08 +0100 Subject: [PATCH] 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 --- src/openvpn/platform.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 } /* -- 2.47.3