From: Jan Rybar Date: Sun, 4 Dec 2016 13:14:14 +0000 (+0100) Subject: library: don't strip off prefixes from the wchan names X-Git-Tag: v4.0.0~751 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5602dd04e11e6bcfc112f6f9e55312bd457405c0;p=procps-ng library: don't strip off prefixes from the wchan names This commit will resolve the RedHat Bugzilla #1322111. [ import from identical commit against master branch ] [ but without trailing whitespace, thank you so much ] Imported by: Jim Warner --- diff --git a/NEWS b/NEWS index 06541e88..5b5a49f0 100644 --- a/NEWS +++ b/NEWS @@ -6,6 +6,7 @@ procps-ng-NEXT * pmap: fix duplicate output line under '-x' option Redhat #1374061 * top: eliminated minor libnuma memory leak * ps: avoid eip/esp address truncations Debain #846361 + * library: don't strip off wchan prefixes (ps & top) Redhat #1322111 procps-ng-3.3.12 ---------------- diff --git a/proc/wchan.c b/proc/wchan.c index b4e40fe1..873a7062 100644 --- a/proc/wchan.c +++ b/proc/wchan.c @@ -46,11 +46,7 @@ const char * lookup_wchan (int pid) { // lame ppc64 has a '.' in front of every name if (*ret=='.') ret++; - switch (*ret){ - case 's': if(!strncmp(ret, "sys_", 4)) ret += 4; break; - case 'd': if(!strncmp(ret, "do_", 3)) ret += 3; break; - case '_': while(*ret=='_') ret++; break; - default : break; - } + while(*ret=='_') ret++; + return ret; }