Commit caf860c2 authored by Pavel Emelyanov's avatar Pavel Emelyanov

proc parse: Small sanitation of maps parsing

Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 2b9fd6ce
...@@ -39,7 +39,6 @@ int parse_maps(pid_t pid, struct list_head *vma_area_list, bool use_map_files) ...@@ -39,7 +39,6 @@ int parse_maps(pid_t pid, struct list_head *vma_area_list, bool use_map_files)
} }
while (fgets(big_buffer, sizeof(big_buffer), maps)) { while (fgets(big_buffer, sizeof(big_buffer), maps)) {
struct stat st_buf;
int num; int num;
char file_path[6]; char file_path[6];
...@@ -116,6 +115,7 @@ int parse_maps(pid_t pid, struct list_head *vma_area_list, bool use_map_files) ...@@ -116,6 +115,7 @@ int parse_maps(pid_t pid, struct list_head *vma_area_list, bool use_map_files)
* disk and restore might need to analyze it. * disk and restore might need to analyze it.
*/ */
if (vma_area->vm_file_fd >= 0) { if (vma_area->vm_file_fd >= 0) {
struct stat st_buf;
if (fstat(vma_area->vm_file_fd, &st_buf) < 0) { if (fstat(vma_area->vm_file_fd, &st_buf) < 0) {
pr_perror("Failed fstat on %d's map %lu", pid, start); pr_perror("Failed fstat on %d's map %lu", pid, start);
...@@ -138,7 +138,7 @@ int parse_maps(pid_t pid, struct list_head *vma_area_list, bool use_map_files) ...@@ -138,7 +138,7 @@ int parse_maps(pid_t pid, struct list_head *vma_area_list, bool use_map_files)
vma_area->shmid = st_buf.st_ino; vma_area->shmid = st_buf.st_ino;
if (!strcmp(file_path, "/SYSV")) { if (!strcmp(file_path, "/SYSV")) {
pr_perror("path: %s\n", file_path); pr_info("path: %s\n", file_path);
vma_area->vma.status |= VMA_AREA_SYSVIPC; vma_area->vma.status |= VMA_AREA_SYSVIPC;
} }
} else { } else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment