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
389b8146
Commit
389b8146
authored
Oct 29, 2013
by
Pavel Emelyanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
restore: Make optional images check right after open
Signed-off-by:
Pavel Emelyanov
<
xemul@parallels.com
>
parent
bb5476cb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
19 deletions
+18
-19
cr-restore.c
cr-restore.c
+18
-19
No files found.
cr-restore.c
View file @
389b8146
...
...
@@ -1891,8 +1891,12 @@ static int open_posix_timers_image(int pid, unsigned long *rpt, int *nr)
*
rpt
=
rst_mem_cpos
();
fd
=
open_image
(
CR_FD_POSIX_TIMERS
,
O_RSTR
,
pid
);
if
(
fd
<
0
)
return
fd
;
if
(
fd
<
0
)
{
if
(
errno
==
ENOENT
)
/* backward compatibility */
return
0
;
else
return
fd
;
}
while
(
1
)
{
PosixTimerEntry
*
pte
;
...
...
@@ -2160,8 +2164,12 @@ static int open_signal_image(int type, pid_t pid, unsigned long *ptr, int *nr)
if
(
ptr
)
*
ptr
=
rst_mem_cpos
();
fd
=
open_image
(
type
,
O_RSTR
,
pid
);
if
(
fd
<
0
)
return
-
1
;
if
(
fd
<
0
)
{
if
(
errno
==
ENOENT
)
/* backward compatibility */
return
0
;
else
return
-
1
;
}
*
nr
=
0
;
while
(
1
)
{
...
...
@@ -2277,28 +2285,19 @@ static int sigreturn_restore(pid_t pid, CoreEntry *core)
goto
err
;
ret
=
open_signal_image
(
CR_FD_SIGNAL
,
pid
,
&
siginfo_chunk
,
&
siginfo_nr
);
if
(
ret
<
0
)
{
if
(
errno
!=
ENOENT
)
/* backward compatibility */
goto
err
;
ret
=
0
;
}
if
(
ret
<
0
)
goto
err
;
for
(
i
=
0
;
i
<
current
->
nr_threads
;
i
++
)
{
ret
=
open_signal_image
(
CR_FD_PSIGNAL
,
current
->
threads
[
i
].
virt
,
NULL
,
&
siginfo_priv_nr
[
i
]);
if
(
ret
<
0
)
{
if
(
errno
!=
ENOENT
)
/* backward compatibility */
goto
err
;
ret
=
0
;
}
if
(
ret
<
0
)
goto
err
;
}
ret
=
open_posix_timers_image
(
pid
,
&
posix_timers_info_chunk
,
&
posix_timers_nr
);
if
(
ret
<
0
)
{
if
(
errno
!=
ENOENT
)
/* backward compatibility */
goto
err
;
ret
=
0
;
}
if
(
ret
<
0
)
goto
err
;
tcp_socks
=
rst_mem_cpos
();
tcp_socks_mem
=
rst_mem_alloc
(
rst_tcp_socks_len
());
...
...
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