2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-31 06:15:24 +00:00

files: Drop redundant lseek in prepare_fds

No need to obtain MAGIC_OFFSET from current position,
the files have predefined structure.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Cyrill Gorcunov
2012-04-10 18:47:00 +04:00
committed by Pavel Emelyanov
parent b0aa868d47
commit a83ad7b813

View File

@@ -446,7 +446,6 @@ int prepare_fds(int pid)
u32 type = 0, ret;
int fdinfo_fd;
int state;
off_t offset, magic_offset;
struct fdinfo_entry fe;
int nr = 0;
@@ -459,10 +458,8 @@ int prepare_fds(int pid)
return -1;
}
magic_offset = lseek(fdinfo_fd, 0, SEEK_CUR);
for (state = 0; state < FD_STATE_MAX; state++) {
lseek(fdinfo_fd, magic_offset, SEEK_SET);
lseek(fdinfo_fd, MAGIC_OFFSET, SEEK_SET);
while (1) {
ret = read_img_eof(fdinfo_fd, &fe);