Skip to content

Commit

Permalink
platform.c: Do not depend Windows build on HAVE_CHDIR
Browse files Browse the repository at this point in the history
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>
(cherry picked from commit 012ea92)
  • Loading branch information
flichtenheld authored and cron2 committed Nov 11, 2023
1 parent 53c9033 commit b705517
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/openvpn/platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -392,19 +392,19 @@ platform_mlockall(bool print_msg)
int
platform_chdir(const char *dir)
{
#ifdef HAVE_CHDIR
#ifdef _WIN32
int res;
struct gc_arena gc = gc_new();
res = _wchdir(wide_string(dir, &gc));
gc_free(&gc);
return res;
#else /* ifdef _WIN32 */
#ifdef HAVE_CHDIR
return chdir(dir);
#endif
#else /* ifdef HAVE_CHDIR */
return -1;
#endif
#endif
}

/*
Expand Down

0 comments on commit b705517

Please sign in to comment.