From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 100383 invoked by alias); 5 Mar 2018 13:25:24 -0000 Mailing-List: contact elfutils-devel-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Post: List-Help: List-Subscribe: Sender: elfutils-devel-owner@sourceware.org Received: (qmail 99726 invoked by uid 89); 5 Mar 2018 13:25:13 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.99.3 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_PASS,TIME_LIMIT_EXCEEDED autolearn=unavailable version=3.3.2 spammy= X-Spam-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_PASS,TIME_LIMIT_EXCEEDED autolearn=unavailable version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on sourceware.org X-Spam-Level: X-HELO: gnu.wildebeest.org Received: from wildebeest.demon.nl (HELO gnu.wildebeest.org) (212.238.236.112) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 05 Mar 2018 13:25:02 +0000 Received: from tarox.wildebeest.org (tarox.wildebeest.org [172.31.17.39]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by gnu.wildebeest.org (Postfix) with ESMTPSA id 0F04E30008A2; Mon, 5 Mar 2018 14:24:59 +0100 (CET) Received: by tarox.wildebeest.org (Postfix, from userid 1000) id C38B7413CAA2; Mon, 5 Mar 2018 14:24:59 +0100 (CET) From: Mark Wielaard To: elfutils-devel@sourceware.org Cc: Mark Wielaard Subject: [PATCH] libdwfl: Use realpath (name, NULL) instead of canonicalize_file_name (name). Date: Mon, 05 Mar 2018 13:25:00 -0000 Message-Id: <1520256296-1352-1-git-send-email-mark@klomp.org> X-Mailer: git-send-email 1.8.3.1 X-Spam-Flag: NO X-IsSubscribed: yes X-SW-Source: 2018-q1/txt/msg00066.txt.bz2 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 --- 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 + + * 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 * 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