1944 |
if (!filename) |
if (!filename) |
1945 |
return 1; |
return 1; |
1946 |
|
|
1947 |
sprintf (filename, "%.*s/%s", dirname_len, dirname, dlname); |
sprintf (filename, "%.*s/%s", (int) dirname_len, dirname, dlname); |
1948 |
|
|
1949 |
/* Now that we have combined DIRNAME and MODULENAME, if there is |
/* Now that we have combined DIRNAME and MODULENAME, if there is |
1950 |
also a PREFIX to contend with, simply recurse with the arguments |
also a PREFIX to contend with, simply recurse with the arguments |
1971 |
const char *old_name; |
const char *old_name; |
1972 |
int installed; |
int installed; |
1973 |
{ |
{ |
|
int error; |
|
|
char *filename; |
|
|
|
|
1974 |
/* Try to open the old library first; if it was dlpreopened, |
/* Try to open the old library first; if it was dlpreopened, |
1975 |
we want the preopened version of it, even if a dlopenable |
we want the preopened version of it, even if a dlopenable |
1976 |
module is available. */ |
module is available. */ |
1982 |
/* Try to open the dynamic library. */ |
/* Try to open the dynamic library. */ |
1983 |
if (dlname) |
if (dlname) |
1984 |
{ |
{ |
|
size_t len; |
|
|
|
|
1985 |
/* try to open the installed module */ |
/* try to open the installed module */ |
1986 |
if (installed && libdir) |
if (installed && libdir) |
1987 |
{ |
{ |
2195 |
{ |
{ |
2196 |
char *dirend = strrchr (filename, '/'); |
char *dirend = strrchr (filename, '/'); |
2197 |
|
|
|
LT_DLFREE (*pdir); |
|
|
*pdir = filename; |
|
|
filename = 0; |
|
|
|
|
2198 |
if (dirend > filename) |
if (dirend > filename) |
2199 |
*dirend = LT_EOS_CHAR; |
*dirend = LT_EOS_CHAR; |
2200 |
|
|
2201 |
is_done = 1; |
LT_DLFREE (*pdir); |
2202 |
|
*pdir = lt_estrdup (filename); |
2203 |
|
is_done = (*pdir == 0) ? -1 : 1; |
2204 |
} |
} |
2205 |
|
|
2206 |
return is_done; |
return is_done; |