diff --git a/pmap.c b/pmap.c index d9bcece0..f2bb555c 100644 --- a/pmap.c +++ b/pmap.c @@ -212,12 +212,12 @@ out_destroy: return; } -static char *mapping_name(struct pids_stack *p, unsigned long addr, +static const char *mapping_name(struct pids_stack *p, unsigned long addr, unsigned long len, const char *mapbuf_b, unsigned showpath, unsigned dev_major, unsigned dev_minor, unsigned long long inode) { - char *cp; + const char *cp; if (!dev_major && dev_minor == shm_minor && strstr(mapbuf_b, "/SYSV")) { static char shmbuf[64]; @@ -232,14 +232,6 @@ static char *mapping_name(struct pids_stack *p, unsigned long addr, return cp[1] ? cp + 1 : cp; } - cp = strchr(mapbuf_b, '/'); - if (cp) { - if (showpath) - return cp; - /* it WILL succeed */ - return strrchr(cp, '/') + 1; - } - cp = _(" [ anon ]"); if (PIDS_VAL(start_stack, ul_int, p, Pids_info) >= addr && (PIDS_VAL(start_stack, ul_int, p, Pids_info) <= addr + len))