public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] libdwfl: Use realpath (name, NULL) instead of canonicalize_file_name (name).
@ 2018-03-05 13:25 Mark Wielaard
  2018-03-09 23:16 ` Mark Wielaard
  0 siblings, 1 reply; 2+ messages in thread
From: Mark Wielaard @ 2018-03-05 13:25 UTC (permalink / raw)
  To: elfutils-devel; +Cc: Mark Wielaard

Some systems apparently don't provide canonicalize_file_name. Since
canonicalize_file_name (path) is defined as realpath(path, NULL) just
use realpath everywhere.

https://sourceware.org/bugzilla/show_bug.cgi?id=21009

Signed-off-by: Mark Wielaard <mark@klomp.org>
---
 libdwfl/ChangeLog                | 6 ++++++
 libdwfl/dwfl_build_id_find_elf.c | 2 +-
 libdwfl/find-debuginfo.c         | 2 +-
 3 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/libdwfl/ChangeLog b/libdwfl/ChangeLog
index b2a7497..1515c41 100644
--- a/libdwfl/ChangeLog
+++ b/libdwfl/ChangeLog
@@ -1,3 +1,9 @@
+2018-03-05  Mark Wielaard  <mark@klomp.org>
+
+	* dwfl_build_id_find_elf.c (__libdwfl_open_by_build_id): Use
+	realpath (name, NULL) instead of canonicalize_file_name (name).
+	* find-debuginfo.c (dwfl_standard_find_debuginfo): Likewise.
+
 2018-01-29  Mark Wielaard  <mark@klomp.org>
 
 	* cu.c (cudie_offset): Use __libdw_first_die_off_from_cu instead of
diff --git a/libdwfl/dwfl_build_id_find_elf.c b/libdwfl/dwfl_build_id_find_elf.c
index ee0c164..cc6c3f6 100644
--- a/libdwfl/dwfl_build_id_find_elf.c
+++ b/libdwfl/dwfl_build_id_find_elf.c
@@ -99,7 +99,7 @@ __libdwfl_open_by_build_id (Dwfl_Module *mod, bool debug, char **file_name,
 	{
 	  if (*file_name != NULL)
 	    free (*file_name);
-	  *file_name = canonicalize_file_name (name);
+	  *file_name = realpath (name, NULL);
 	  if (*file_name == NULL)
 	    {
 	      *file_name = name;
diff --git a/libdwfl/find-debuginfo.c b/libdwfl/find-debuginfo.c
index 6d5a42a..9267788 100644
--- a/libdwfl/find-debuginfo.c
+++ b/libdwfl/find-debuginfo.c
@@ -389,7 +389,7 @@ dwfl_standard_find_debuginfo (Dwfl_Module *mod,
       /* If FILE_NAME is a symlink, the debug file might be associated
 	 with the symlink target name instead.  */
 
-      char *canon = canonicalize_file_name (file_name);
+      char *canon = realpath (file_name, NULL);
       if (canon != NULL && strcmp (file_name, canon))
 	fd = find_debuginfo_in_path (mod, canon,
 				     debuglink_file, debuglink_crc,
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] libdwfl: Use realpath (name, NULL) instead of canonicalize_file_name (name).
  2018-03-05 13:25 [PATCH] libdwfl: Use realpath (name, NULL) instead of canonicalize_file_name (name) Mark Wielaard
@ 2018-03-09 23:16 ` Mark Wielaard
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Wielaard @ 2018-03-09 23:16 UTC (permalink / raw)
  To: elfutils-devel

On Mon, Mar 05, 2018 at 02:24:56PM +0100, Mark Wielaard wrote:
> Some systems apparently don't provide canonicalize_file_name. Since
> canonicalize_file_name (path) is defined as realpath(path, NULL) just
> use realpath everywhere.

Pushed to master.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-03-09 23:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-05 13:25 [PATCH] libdwfl: Use realpath (name, NULL) instead of canonicalize_file_name (name) Mark Wielaard
2018-03-09 23:16 ` Mark Wielaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).