From owner-svn-src-head@freebsd.org Fri Dec 1 10:25:53 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C63FCDFB0B2; Fri, 1 Dec 2017 10:25:53 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9377E7A21E; Fri, 1 Dec 2017 10:25:53 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vB1APqLt073529; Fri, 1 Dec 2017 10:25:52 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vB1APq5f073528; Fri, 1 Dec 2017 10:25:52 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201712011025.vB1APq5f073528@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Fri, 1 Dec 2017 10:25:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326423 - head/lib/libproc/tests X-SVN-Group: head X-SVN-Commit-Author: ed X-SVN-Commit-Paths: head/lib/libproc/tests X-SVN-Commit-Revision: 326423 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Dec 2017 10:25:53 -0000 Author: ed Date: Fri Dec 1 10:25:52 2017 New Revision: 326423 URL: https://svnweb.freebsd.org/changeset/base/326423 Log: Eliminate the last user of basename_r() in the base system. In this case it's fairly easy to make use of basename(). Modified: head/lib/libproc/tests/proc_test.c Modified: head/lib/libproc/tests/proc_test.c ============================================================================== --- head/lib/libproc/tests/proc_test.c Fri Dec 1 09:59:42 2017 (r326422) +++ head/lib/libproc/tests/proc_test.c Fri Dec 1 10:25:52 2017 (r326423) @@ -105,7 +105,7 @@ static void verify_bkpt(struct proc_handle *phdl, GElf_Sym *sym, const char *symname, const char *mapname) { - char mapbname[MAXPATHLEN], *name; + char *name, *mapname_copy, *mapbname; GElf_Sym tsym; prmap_t *map; size_t namesz; @@ -147,9 +147,11 @@ verify_bkpt(struct proc_handle *phdl, GElf_Sym *sym, c map = proc_addr2map(phdl, addr); ATF_REQUIRE_MSG(map != NULL, "failed to look up map for address 0x%lx", addr); - basename_r(map->pr_mapname, mapbname); + mapname_copy = strdup(map->pr_mapname); + mapbname = basename(mapname_copy); ATF_REQUIRE_EQ_MSG(strcmp(mapname, mapbname), 0, "expected map name '%s' doesn't match '%s'", mapname, mapbname); + free(mapname_copy); } ATF_TC(map_alias_name2map);