]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
configure/cmake: check for realpath
authorDaniel Stenberg <daniel@haxx.se>
Thu, 6 Feb 2025 21:35:09 +0000 (22:35 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 7 Feb 2025 08:45:20 +0000 (09:45 +0100)
And make vtls_scache use HAVE_REALPATH

Fixes #16209
Reported-by: Andrew Kirillov
Closes #16225

CMakeLists.txt
configure.ac
lib/curl_config.h.cmake
lib/vtls/vtls_scache.c

index 810dcbbc6da6dfd88217fd1ed3ad2f75fd233f42..b2b44347975687a855978f483a017249d3db97ba 100644 (file)
@@ -1735,6 +1735,7 @@ check_function_exists("setmode"         HAVE_SETMODE)
 check_function_exists("setrlimit"       HAVE_SETRLIMIT)
 
 if(NOT WIN32)
+  check_function_exists("realpath"      HAVE_REALPATH)
   check_function_exists("sched_yield"   HAVE_SCHED_YIELD)
   check_symbol_exists("strcasecmp"      "string.h" HAVE_STRCASECMP)
   check_symbol_exists("stricmp"         "string.h" HAVE_STRICMP)
index d492f9e9415cb9e57dc4009ee7c9ca01124c003f..a2879568ead66355950725e9eefcab452273d06a 100644 (file)
@@ -4080,7 +4080,10 @@ AC_CHECK_FUNCS([\
 ])
 
 if test "$curl_cv_native_windows" != 'yes'; then
-  AC_CHECK_FUNCS([sched_yield])
+  AC_CHECK_FUNCS([\
+  sched_yield \
+  realpath \
+  ])
   CURL_CHECK_FUNC_STRCASECMP
   CURL_CHECK_FUNC_STRCMPI
   CURL_CHECK_FUNC_STRICMP
index a41af0c982d9d690bd19306e5b60c803cb66b309..f4f3a186d4a86d6d279e7309d1ccaa892d35b2ea 100644 (file)
 /* If you have poll */
 #cmakedefine HAVE_POLL 1
 
+/* If you have realpath */
+#cmakedefine HAVE_REALPATH 1
+
 /* Define to 1 if you have the <poll.h> header file. */
 #cmakedefine HAVE_POLL_H 1
 
index 9c04b7762300c88699ad977301ea7c238ee1d1a9..4250a6c69aec1b0c94f2c4a67f6fd450185a2082 100644 (file)
@@ -359,7 +359,7 @@ static CURLcode cf_ssl_peer_key_add_path(struct dynbuf *buf,
     char abspath[_MAX_PATH];
     if(_fullpath(abspath, path, _MAX_PATH))
       return Curl_dyn_addf(buf, ":%s-%s", name, abspath);
-#else
+#elif defined(HAVE_REALPATH)
     if(path[0] != '/') {
       char *abspath = realpath(path, NULL);
       if(abspath) {