Commit d1b3fd09 authored by Pavel Emelyanov's avatar Pavel Emelyanov Committed by Cyrill Gorcunov

fdinfo: fd_is_special helper for maps and cwd

Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
parent e2d8aec7
...@@ -178,10 +178,9 @@ int prepare_fd_pid(int pid) ...@@ -178,10 +178,9 @@ int prepare_fd_pid(int pid)
if (e.len) if (e.len)
lseek(fdinfo_fd, e.len, SEEK_CUR); lseek(fdinfo_fd, e.len, SEEK_CUR);
if (e.type == FDINFO_MAP) if (fd_is_special(&e))
continue;
if (e.addr == FDINFO_CWD)
continue; continue;
if (collect_fd(pid, &e)) if (collect_fd(pid, &e))
return -1; return -1;
} }
...@@ -534,7 +533,7 @@ int prepare_fds(int pid) ...@@ -534,7 +533,7 @@ int prepare_fds(int pid)
goto err; goto err;
continue; continue;
} }
} else if (fe.type == FDINFO_MAP || fe.addr == FDINFO_CWD) { } else if (fd_is_special(&fe)) {
lseek(fdinfo_fd, fe.len, SEEK_CUR); lseek(fdinfo_fd, fe.len, SEEK_CUR);
continue; continue;
} }
......
...@@ -35,6 +35,8 @@ struct fdinfo_entry { ...@@ -35,6 +35,8 @@ struct fdinfo_entry {
u8 name[0]; u8 name[0];
} __packed; } __packed;
#define fd_is_special(fe) (((fe)->type != FDINFO_FD) || ((fe)->addr == FDINFO_CWD))
struct shmem_entry { struct shmem_entry {
u64 start; u64 start;
u64 end; u64 end;
......
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