Description: pmap: output when smaps unreadable
 If smaps can be opened but not readable, the output
 is now the same as if the file cannot be opened
Bug-Debian: https://bugs.debian.org/775624
Last-Update: 2015-03-07
--- a/pmap.c
+++ b/pmap.c
@@ -533,6 +533,10 @@
 	 */
 	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 @@
 			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;
