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 <frank@lichtenheld.com>
Acked-by: Lev Stipakov <lstipakov@gmail.com>
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 <gert@greenie.muc.de>
int
platform_chdir(const char *dir)
{
-#ifdef HAVE_CHDIR
#ifdef _WIN32
int res;
struct gc_arena gc = gc_new();
gc_free(&gc);
return res;
#else /* ifdef _WIN32 */
+#ifdef HAVE_CHDIR
return chdir(dir);
-#endif
#else /* ifdef HAVE_CHDIR */
return -1;
#endif
+#endif
}
/*