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
4727c739
Commit
4727c739
authored
Sep 28, 2011
by
Cyrill Gorcunov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
restore: Simplify try_fixup_file_map
Signed-off-by:
Cyrill Gorcunov
<
gorcunov@gmail.com
>
parent
69781946
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
12 deletions
+15
-12
cr-restore.c
cr-restore.c
+15
-12
No files found.
cr-restore.c
View file @
4727c739
...
...
@@ -588,23 +588,26 @@ static int prepare_shmem(int pid)
return
0
;
}
static
int
try_fixup_file_map
(
int
pid
,
struct
vma_entry
*
v
i
,
int
fd
)
static
int
try_fixup_file_map
(
int
pid
,
struct
vma_entry
*
v
ma_entry
,
int
fd
)
{
struct
fmap_fd
*
fm
fd
;
struct
fmap_fd
*
fm
ap_fd
=
pop_fmap_fd
(
pid
,
vma_entry
->
start
)
;
fmfd
=
pop_fmap_fd
(
pid
,
vi
->
start
);
if
(
fmfd
!=
NULL
)
{
pr_info
(
"%d: Fixing %lx vma to %d fd
\n
"
,
pid
,
vi
->
start
,
fm
fd
->
fd
);
lseek
(
fd
,
-
sizeof
(
*
vi
),
SEEK_CUR
);
vi
->
fd
=
fmfd
->
fd
;
if
(
write
(
fd
,
vi
,
sizeof
(
*
vi
))
!=
sizeof
(
*
vi
))
{
perror
(
"Can't write img"
);
return
1
;
}
free
(
fmfd
);
if
(
fmap_fd
)
{
pr_info
(
"%d: Fixing %lx vma to %d fd
\n
"
,
pid
,
vma_entry
->
start
,
fmap_
fd
->
fd
);
lseek
(
fd
,
-
sizeof
(
*
vma_entry
),
SEEK_CUR
)
;
vma_entry
->
fd
=
fmap_fd
->
fd
;
write_ptr_safe
(
fd
,
&
vma_entry
,
err
)
;
free
(
fm
ap_
fd
);
}
return
0
;
err:
pr_perror
(
"%d: Can't fixup vma
\n
"
,
pid
);
return
1
;
}
static
int
try_fixup_shared_map
(
int
pid
,
struct
vma_entry
*
vi
,
int
fd
)
...
...
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