mirror of
https://github.com/shadowsocks/shadowsocks-libev.git
synced 2026-10-21 14:33:55 +00:00
Detect get_current_dir_name in configure
This commit is contained in:
+1
-1
@@ -212,7 +212,7 @@ dnl Checks for library functions.
|
||||
AC_FUNC_FORK
|
||||
AC_FUNC_SELECT_ARGTYPES
|
||||
AC_TYPE_SIGNAL
|
||||
AC_CHECK_FUNCS([memset select setresuid setreuid strerror getpwnam_r setrlimit])
|
||||
AC_CHECK_FUNCS([memset select setresuid setreuid strerror get_current_dir_name getpwnam_r setrlimit])
|
||||
|
||||
AC_CHECK_LIB(socket, connect)
|
||||
|
||||
|
||||
+2
-2
@@ -239,7 +239,7 @@ start_plugin(const char *plugin,
|
||||
env = cork_env_clone_current();
|
||||
current_path = cork_env_get(env, "PATH");
|
||||
if (current_path != NULL) {
|
||||
#ifdef _GNU_SOURCE
|
||||
#ifdef HAVE_GET_CURRENT_DIR_NAME
|
||||
char *cwd = get_current_dir_name();
|
||||
if (cwd) {
|
||||
#else
|
||||
@@ -249,7 +249,7 @@ start_plugin(const char *plugin,
|
||||
new_path_len = strlen(current_path) + strlen(cwd) + 2;
|
||||
new_path = ss_malloc(new_path_len);
|
||||
snprintf(new_path, new_path_len, "%s:%s", cwd, current_path);
|
||||
#ifdef _GNU_SOURCE
|
||||
#ifdef HAVE_GET_CURRENT_DIR_NAME
|
||||
free(cwd);
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user