Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
criu
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhul
criu
Commits
7a98cd2b
Commit
7a98cd2b
authored
Mar 23, 2012
by
Pavel Emelyanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
files: Sanitize fd restore state machine again
Signed-off-by:
Pavel Emelyanov
<
xemul@parallels.com
>
parent
ebc1ac8b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
21 deletions
+16
-21
files.c
files.c
+16
-21
No files found.
files.c
View file @
7a98cd2b
...
@@ -442,7 +442,7 @@ static int open_special_fdinfo(int pid, struct fdinfo_entry *fe,
...
@@ -442,7 +442,7 @@ static int open_special_fdinfo(int pid, struct fdinfo_entry *fe,
int
prepare_fds
(
int
pid
)
int
prepare_fds
(
int
pid
)
{
{
u32
type
=
0
,
err
=
-
1
,
ret
;
u32
type
=
0
,
ret
;
int
fdinfo_fd
;
int
fdinfo_fd
;
int
state
;
int
state
;
off_t
offset
,
magic_offset
;
off_t
offset
,
magic_offset
;
...
@@ -464,34 +464,29 @@ int prepare_fds(int pid)
...
@@ -464,34 +464,29 @@ int prepare_fds(int pid)
lseek
(
fdinfo_fd
,
magic_offset
,
SEEK_SET
);
lseek
(
fdinfo_fd
,
magic_offset
,
SEEK_SET
);
while
(
1
)
{
while
(
1
)
{
ret
=
read
(
fdinfo_fd
,
&
fe
,
sizeof
(
fe
)
);
ret
=
read
_img_eof
(
fdinfo_fd
,
&
fe
);
if
(
ret
=
=
0
)
if
(
ret
<
=
0
)
break
;
break
;
if
(
ret
!=
sizeof
(
fe
))
{
if
(
fd_is_special
(
&
fe
))
pr_perror
(
"%d: Bad fdinfo entry"
,
pid
);
ret
=
open_special_fdinfo
(
pid
,
&
fe
,
goto
err
;
fdinfo_fd
,
state
);
else
{
offset
=
lseek
(
fdinfo_fd
,
0
,
SEEK_CUR
);
ret
=
open_fdinfo
(
pid
,
&
fe
,
&
fdinfo_fd
,
state
);
lseek
(
fdinfo_fd
,
offset
+
fe
.
len
,
SEEK_SET
);
}
}
if
(
fd_is_special
(
&
fe
))
{
if
(
ret
)
if
(
open_special_fdinfo
(
pid
,
&
fe
,
fdinfo_fd
,
state
))
break
;
goto
err
;
continue
;
}
}
offset
=
lseek
(
fdinfo_fd
,
0
,
SEEK_CUR
);
if
(
ret
)
break
;
if
(
open_fdinfo
(
pid
,
&
fe
,
&
fdinfo_fd
,
state
))
goto
err
;
lseek
(
fdinfo_fd
,
offset
+
fe
.
len
,
SEEK_SET
);
}
}
}
err
=
0
;
err:
close
(
fdinfo_fd
);
close
(
fdinfo_fd
);
return
err
;
return
ret
;
}
}
static
struct
fmap_fd
*
pull_fmap_fd
(
int
pid
,
unsigned
long
start
)
static
struct
fmap_fd
*
pull_fmap_fd
(
int
pid
,
unsigned
long
start
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment