Skip to content
Snippets Groups Projects
Commit 9b201eb4 authored by Marcus Comstedt's avatar Marcus Comstedt
Browse files

I/O: Don't use mallocing getcwd with USE_DL_MALLOC

The returned memory would be allocated by the wrong allocator,
causing an abort when it is freed.
parent b78e7bed
Branches
Tags
No related merge requests found
...@@ -465,10 +465,10 @@ static int PIKE_UNUSED_ATTRIBUTE debug_fd_mkdir(const char *dir, int mode) ...@@ -465,10 +465,10 @@ static int PIKE_UNUSED_ATTRIBUTE debug_fd_mkdir(const char *dir, int mode)
#endif #endif
#define fd_rename(O,N) rename(O,N) #define fd_rename(O,N) rename(O,N)
#define fd_chdir(DIR) chdir(DIR) #define fd_chdir(DIR) chdir(DIR)
#ifdef HAVE_GET_CURRENT_DIR_NAME #if defined(HAVE_GET_CURRENT_DIR_NAME) && !defined(USE_DL_MALLOC)
/* Glibc extension... */ /* Glibc extension... */
#define fd_get_current_dir_name() get_current_dir_name() #define fd_get_current_dir_name() get_current_dir_name()
#elif defined(HAVE_WORKING_GETCWD) #elif defined(HAVE_WORKING_GETCWD) && !defined(USE_DL_MALLOC)
#if HAVE_WORKING_GETCWD #if HAVE_WORKING_GETCWD
/* Glibc and win32 (HAVE_WORKING_GETCWD == 1). /* Glibc and win32 (HAVE_WORKING_GETCWD == 1).
* *
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment