* dlfcn.cc (get_full_path_of_dll): Allow paths up to PATH_MAX.
(dlopen): Call get_full_path_of_dll with path buffer allocate by tmp_pathbuf.
This commit is contained in:
parent
4855f6c517
commit
0c4cb56009
|
@ -1,3 +1,9 @@
|
||||||
|
2008-03-11 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
|
* dlfcn.cc (get_full_path_of_dll): Allow paths up to PATH_MAX.
|
||||||
|
(dlopen): Call get_full_path_of_dll with path buffer allocate by
|
||||||
|
tmp_pathbuf.
|
||||||
|
|
||||||
2008-03-11 Corinna Vinschen <corinna@vinschen.de>
|
2008-03-11 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
* spawn.cc (find_exec): Use tmp_pathbuf to allocate path buffer.
|
* spawn.cc (find_exec): Use tmp_pathbuf to allocate path buffer.
|
||||||
|
|
|
@ -23,6 +23,7 @@ details. */
|
||||||
#include "dlfcn.h"
|
#include "dlfcn.h"
|
||||||
#include "dll_init.h"
|
#include "dll_init.h"
|
||||||
#include "cygtls.h"
|
#include "cygtls.h"
|
||||||
|
#include "tls_pbuf.h"
|
||||||
|
|
||||||
static void __stdcall
|
static void __stdcall
|
||||||
set_dl_error (const char *str)
|
set_dl_error (const char *str)
|
||||||
|
@ -48,7 +49,7 @@ get_full_path_of_dll (const char* str, char *name)
|
||||||
int len = strlen (str);
|
int len = strlen (str);
|
||||||
|
|
||||||
/* empty string or too long to be legal win32 pathname? */
|
/* empty string or too long to be legal win32 pathname? */
|
||||||
if (len == 0 || len >= CYG_MAX_PATH)
|
if (len == 0 || len >= PATH_MAX)
|
||||||
return str; /* Yes. Let caller deal with it. */
|
return str; /* Yes. Let caller deal with it. */
|
||||||
|
|
||||||
const char *ret;
|
const char *ret;
|
||||||
|
@ -91,7 +92,8 @@ dlopen (const char *name, int)
|
||||||
ret = (void *) GetModuleHandle (NULL); /* handle for the current module */
|
ret = (void *) GetModuleHandle (NULL); /* handle for the current module */
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
char buf[CYG_MAX_PATH];
|
tmp_pathbuf tp;
|
||||||
|
char *buf = tp.c_get ();
|
||||||
/* handle for the named library */
|
/* handle for the named library */
|
||||||
const char *fullpath = get_full_path_of_dll (name, buf);
|
const char *fullpath = get_full_path_of_dll (name, buf);
|
||||||
if (!fullpath)
|
if (!fullpath)
|
||||||
|
|
Loading…
Reference in New Issue