Fixed smaps parsing with linux > 2.6.21.

Closes #449595.
Improved example.

svn path=/trunk/; revision=2610
This commit is contained in:
Benoît Dejean
2007-06-25 17:27:29 +00:00
parent 6b0bafcafb
commit 1e0ba1d7aa
2 changed files with 4 additions and 5 deletions

View File

@@ -164,11 +164,10 @@ glibtop_get_proc_map_s (glibtop *server, glibtop_proc_map *buf, pid_t pid)
if (getline(&line, &line_size, maps) == -1)
break;
/* 8 arguments */
if (sscanf(line, PROC_MAPS_FORMAT,
&start, &end, flags, &offset,
&dev_major, &dev_minor, &inode, &line_end) != 7)
break;
continue;
filename = line + line_end;
g_strstrip(filename);