diff --git a/NEWS b/NEWS index 55981d44..08fb48e3 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,7 @@ procps-ng-NEXT ---------------- * pgrep: don't crash with -a -w flags. Merge 33, Debian #768190 * skill: command line with signal number interpreted correctly + * pmap: print process name even if smaps is unreadable Debian #775624 procps-ng-3.3.10 ---------------- diff --git a/pmap.c b/pmap.c index c83617cd..17e0e304 100644 --- a/pmap.c +++ b/pmap.c @@ -533,6 +533,10 @@ static int one_proc(proc_t * p) */ int maxcmd = 0xfffff; + escape_command(cmdbuf, p, sizeof cmdbuf, &maxcmd, + ESC_ARGS | ESC_BRACKETS); + printf("%u: %s\n", p->tgid, cmdbuf); + if (x_option || X_option || c_option) { sprintf(buf, "/proc/%u/smaps", p->tgid); if ((fp = fopen(buf, "r")) == NULL) @@ -543,10 +547,6 @@ static int one_proc(proc_t * p) return 1; } - escape_command(cmdbuf, p, sizeof cmdbuf, &maxcmd, - ESC_ARGS | ESC_BRACKETS); - printf("%u: %s\n", p->tgid, cmdbuf); - if (X_option || c_option) { print_extended_maps(fp); return 0;