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 #448

Change-Id: I0c78ce452135fe2c80275da449215ba926471018
Signed-off-by: Frank Lichtenheld <[email protected]>
Acked-by: Lev Stipakov <[email protected]>
Message-Id: <[email protected]>
URL: https://www.mail-archive.com/[email protected]/msg27362.html
Signed-off-by: Gert Doering <[email protected]>
  • Loading branch information
flichtenheld authored and cron2 committed Nov 11, 2023
1 parent 753cba2 commit 012ea92
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 012ea92

Please sign in to comment.