Message ID | 20231111081808.30967-1-gert@greenie.muc.de |
---|---|
State | Accepted |
Headers | show |
Series | [Openvpn-devel,v1] platform.c: Do not depend Windows build on HAVE_CHDIR | expand |
This patch will do the job, but I think (at least for "master") we should do a bit more thorough job - as in, get rid of HAVE_CHDIR completely, in autoconf, cmake, header files. There is no platform where we have a remote chance in getting OpenVPN ported that has no chdir(), so this is all a nice excercise in achieving nothing. I have not tested this beyond "does it compile?" but the change looks reasonable and Lev has ACKed it. Your patch has been applied to the master and release/2.6 branch. commit 012ea92c414282488e3d60c87452849bde64aac4 (master) commit b705517b12d14876a12593416a45756b7a952f1e (release/2.6) Author: Frank Lichtenheld Date: Sat Nov 11 09:18:08 2023 +0100 platform.c: Do not depend Windows build on HAVE_CHDIR 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> -- kind regards, Gert Doering
diff --git a/src/openvpn/platform.c b/src/openvpn/platform.c index 32c4fe6..62acabe 100644 --- a/src/openvpn/platform.c +++ b/src/openvpn/platform.c @@ -392,7 +392,6 @@ int platform_chdir(const char *dir) { -#ifdef HAVE_CHDIR #ifdef _WIN32 int res; struct gc_arena gc = gc_new(); @@ -400,11 +399,12 @@ gc_free(&gc); return res; #else /* ifdef _WIN32 */ +#ifdef HAVE_CHDIR return chdir(dir); -#endif #else /* ifdef HAVE_CHDIR */ return -1; #endif +#endif } /*