Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 1 Dec 2017 10:25:52 +0000 (UTC)
From:      Ed Schouten <ed@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r326423 - head/lib/libproc/tests
Message-ID:  <201712011025.vB1APq5f073528@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201712011025.vB1APq5f073528>