In parse_maps_line of the original code, we called readlink after stat
for gathering arguments that were passed to new_file().
The order was different from that in collect_file_symlink.
In parse_maps_line, we called stat after readlink.
The difference of the order may make the way of handling
errors of readlink and stat complicated.
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
try_map_files:
snprintf(map_file, sizeof(map_file), "map_files/%"PRIx64"-%"PRIx64, start, end);
- if (ul_path_stat(pc, &sb, 0, map_file) < 0)
- return;
if (ul_path_readlink(pc, sym, sizeof(sym), map_file) < 0)
return;
+ if (ul_path_stat(pc, &sb, 0, map_file) < 0)
+ return;
f = new_file(proc, stat2class(&sb), &sb, sym, -assoc);
}