eina: find a real path of dynamic library
In general case, user library path is specifed as /usr/lib/, however, if the user library path is specified as /lib/ which is a symbolic link to /usr/lib/, current eina_prefix_new logic will print warning messages. (actually the logic finds a /usr/lib/ path once a fallback logic runs) This patch modifies the logic to find a proper path of lib path even if it is specified as symlink. Differential Revision: https://phab.enlightenment.org/D6869
This commit is contained in:
parent
a6ee2061a3
commit
3ea6f58ec6
|
@ -581,7 +581,16 @@ eina_prefix_new(const char *argv0, void *symbol, const char *envprefix,
|
|||
if (_path_absolute_check(info_dl.dli_fname))
|
||||
{
|
||||
INF("dladdr for symbol=%p: %s", symbol, info_dl.dli_fname);
|
||||
STRDUP_REP(pfx->exe_path, info_dl.dli_fname);
|
||||
char *rlink = realpath(info_dl.dli_fname, NULL);
|
||||
if (rlink)
|
||||
{
|
||||
IF_FREE_NULL(pfx->exe_path);
|
||||
pfx->exe_path = rlink;
|
||||
}
|
||||
else
|
||||
{
|
||||
STRDUP_REP(pfx->exe_path, info_dl.dli_fname);
|
||||
}
|
||||
from_lib = EINA_TRUE;
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue