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
3971dbb7
Commit
3971dbb7
authored
Sep 28, 2011
by
Cyrill Gorcunov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
restore: File mappings should use process pid as well
Signed-off-by:
Cyrill Gorcunov
<
gorcunov@gmail.com
>
parent
2de8de5d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
cr-restore.c
cr-restore.c
+7
-4
No files found.
cr-restore.c
View file @
3971dbb7
...
...
@@ -32,6 +32,7 @@
struct
fmap_fd
{
struct
fmap_fd
*
next
;
unsigned
long
start
;
int
pid
;
int
fd
;
};
...
...
@@ -362,14 +363,14 @@ static int prepare_shared(int ps_fd)
return
0
;
}
static
struct
fmap_fd
*
pop_fmap_fd
(
unsigned
long
start
)
static
struct
fmap_fd
*
pop_fmap_fd
(
int
pid
,
unsigned
long
start
)
{
struct
fmap_fd
**
p
,
*
r
;
pr_info
(
"
Looking for %lx : "
,
start
);
pr_info
(
"
%d: Looking for %lx : "
,
pid
,
start
);
for
(
p
=
&
fmap_fds
;
*
p
!=
NULL
;
p
=
&
(
*
p
)
->
next
)
{
if
((
*
p
)
->
start
!=
start
)
if
((
*
p
)
->
start
!=
start
||
(
*
p
)
->
pid
!=
pid
)
continue
;
r
=
*
p
;
...
...
@@ -446,6 +447,8 @@ static int open_fmap(int pid, struct fdinfo_entry *fe, int fd)
new
->
start
=
fe
->
addr
;
new
->
fd
=
tmp
;
new
->
next
=
fmap_fds
;
new
->
pid
=
pid
;
fmap_fds
=
new
;
return
0
;
...
...
@@ -584,7 +587,7 @@ static int try_fixup_file_map(int pid, struct vma_entry *vi, int fd)
{
struct
fmap_fd
*
fmfd
;
fmfd
=
pop_fmap_fd
(
vi
->
start
);
fmfd
=
pop_fmap_fd
(
pid
,
vi
->
start
);
if
(
fmfd
!=
NULL
)
{
pr_info
(
"%d: Fixing %lx vma to %d fd
\n
"
,
pid
,
vi
->
start
,
fmfd
->
fd
);
lseek
(
fd
,
-
sizeof
(
*
vi
),
SEEK_CUR
);
...
...
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