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

files: Drop redundant lseek in prepare_fds

No need to obtain MAGIC_OFFSET from current position,
the files have predefined structure.
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent b0aa868d
......@@ -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);
......
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