2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-09-03 15:55:53 +00:00

fdinfo: fd_is_special helper for maps and cwd

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
This commit is contained in:
Pavel Emelyanov
2012-01-16 19:17:24 +04:00
committed by Cyrill Gorcunov
parent e2d8aec7f5
commit d1b3fd09b3
2 changed files with 5 additions and 4 deletions

View File

@@ -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)
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;
} }

View File

@@ -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;