Skip to content

Commit

Permalink
Detect get_current_dir_name in configure
Browse files Browse the repository at this point in the history
  • Loading branch information
madeye committed Feb 17, 2017
1 parent 41263c3 commit dddbfd2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
4 changes: 2 additions & 2 deletions src/plugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
}
Expand Down

0 comments on commit dddbfd2

Please sign in to comment.