Skip to content
Snippets Groups Projects
Commit 5625f382 authored by David Hedbor's avatar David Hedbor
Browse files

getwd f|rst, sedan getcwd

Rev: src/modules/files/configure.in:1.2
Rev: src/modules/files/efuns.c:1.2
parent aac8e6d9
No related branches found
No related tags found
No related merge requests found
...@@ -9,7 +9,7 @@ AC_HAVE_HEADERS(arpa/inet.h sys/socketvar.h netinet/in.h) ...@@ -9,7 +9,7 @@ AC_HAVE_HEADERS(arpa/inet.h sys/socketvar.h netinet/in.h)
AC_HEADER_DIRENT AC_HEADER_DIRENT
AC_CHECK_LIB(socket, socket) AC_CHECK_LIB(socket, socket)
AC_HAVE_FUNCS(socketpair) AC_HAVE_FUNCS(socketpair getwd getcwd)
AC_MSG_CHECKING(size of socket buffers) AC_MSG_CHECKING(size of socket buffers)
AC_CACHE_VAL(lpc_cv_socket_buffer_max, AC_CACHE_VAL(lpc_cv_socket_buffer_max,
......
...@@ -194,12 +194,14 @@ void f_getcwd(INT32 args) ...@@ -194,12 +194,14 @@ void f_getcwd(INT32 args)
char *e; char *e;
pop_n_elems(args); pop_n_elems(args);
#ifdef HAVE_GETCWD #ifdef HAVE_GETWD
e=(char *)getcwd(0,1000);
#else
e=(char *)getwd((char *)malloc(MAXPATHLEN+1)); e=(char *)getwd((char *)malloc(MAXPATHLEN+1));
if(!e) if(!e)
fatal("Couldn't fetch current path.\n"); fatal("Couldn't fetch current path.\n");
#else
#ifdef HAVE_GETCWD
e=(char *)getcwd(0,1000);
#endif
#endif #endif
push_string(make_shared_string(e)); push_string(make_shared_string(e));
free(e); free(e);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment