summaryrefslogtreecommitdiff
path: root/src/lib/eina
diff options
context:
space:
mode:
authorWonki Kim <wonki_.kim@samsung.com>2018-08-24 10:32:10 +0000
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2018-08-24 15:48:38 +0200
commit3ea6f58ec68e465c14118dcb7b39fdece5b58b9d (patch)
treec2d7a893dfa059b896df6520d869ed7377614703 /src/lib/eina
parenta6ee2061a31a73a7b71d2142912da583933ed6d2 (diff)
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
Diffstat (limited to 'src/lib/eina')
-rw-r--r--src/lib/eina/eina_prefix.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/lib/eina/eina_prefix.c b/src/lib/eina/eina_prefix.c
index 710e949c35..51ec9b3136 100644
--- a/src/lib/eina/eina_prefix.c
+++ b/src/lib/eina/eina_prefix.c
@@ -581,7 +581,16 @@ eina_prefix_new(const char *argv0, void *symbol, const char *envprefix,
581 if (_path_absolute_check(info_dl.dli_fname)) 581 if (_path_absolute_check(info_dl.dli_fname))
582 { 582 {
583 INF("dladdr for symbol=%p: %s", symbol, info_dl.dli_fname); 583 INF("dladdr for symbol=%p: %s", symbol, info_dl.dli_fname);
584 STRDUP_REP(pfx->exe_path, info_dl.dli_fname); 584 char *rlink = realpath(info_dl.dli_fname, NULL);
585 if (rlink)
586 {
587 IF_FREE_NULL(pfx->exe_path);
588 pfx->exe_path = rlink;
589 }
590 else
591 {
592 STRDUP_REP(pfx->exe_path, info_dl.dli_fname);
593 }
585 from_lib = EINA_TRUE; 594 from_lib = EINA_TRUE;
586 } 595 }
587 else 596 else