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
54862513
Commit
54862513
authored
Aug 07, 2014
by
Pavel Emelyanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pstree: Introduce task_alive() helper
Signed-off-by:
Pavel Emelyanov
<
xemul@parallels.com
>
parent
ab1be206
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
12 deletions
+8
-12
cr-restore.c
cr-restore.c
+3
-12
pstree.h
include/pstree.h
+5
-0
No files found.
cr-restore.c
View file @
54862513
...
@@ -643,11 +643,8 @@ static int prepare_sigactions(void)
...
@@ -643,11 +643,8 @@ static int prepare_sigactions(void)
int
sig
,
rst
=
0
;
int
sig
,
rst
=
0
;
int
ret
=
0
;
int
ret
=
0
;
switch
(
current
->
state
)
{
if
(
!
task_alive
(
current
))
case
TASK_HELPER
:
case
TASK_DEAD
:
return
0
;
return
0
;
}
pr_info
(
"Restore sigacts for %d
\n
"
,
pid
);
pr_info
(
"Restore sigacts for %d
\n
"
,
pid
);
...
@@ -1474,10 +1471,7 @@ static int attach_to_tasks(bool root_seized)
...
@@ -1474,10 +1471,7 @@ static int attach_to_tasks(bool root_seized)
pid_t
pid
=
item
->
pid
.
real
;
pid_t
pid
=
item
->
pid
.
real
;
int
status
,
i
;
int
status
,
i
;
if
(
item
->
state
==
TASK_DEAD
)
if
(
!
task_alive
(
item
))
continue
;
if
(
item
->
state
==
TASK_HELPER
)
continue
;
continue
;
if
(
parse_threads
(
item
->
pid
.
real
,
&
item
->
threads
,
&
item
->
nr_threads
))
if
(
parse_threads
(
item
->
pid
.
real
,
&
item
->
threads
,
&
item
->
nr_threads
))
...
@@ -1527,10 +1521,7 @@ static void finalize_restore(int status)
...
@@ -1527,10 +1521,7 @@ static void finalize_restore(int status)
struct
parasite_ctl
*
ctl
;
struct
parasite_ctl
*
ctl
;
int
i
;
int
i
;
if
(
item
->
state
==
TASK_DEAD
)
if
(
!
task_alive
(
item
))
continue
;
if
(
item
->
state
==
TASK_HELPER
)
continue
;
continue
;
if
(
status
<
0
)
if
(
status
<
0
)
...
...
include/pstree.h
View file @
54862513
...
@@ -40,6 +40,11 @@ static inline int shared_fdtable(struct pstree_item *item) {
...
@@ -40,6 +40,11 @@ static inline int shared_fdtable(struct pstree_item *item) {
item
->
ids
->
files_id
==
item
->
parent
->
ids
->
files_id
);
item
->
ids
->
files_id
==
item
->
parent
->
ids
->
files_id
);
}
}
static
inline
bool
task_alive
(
struct
pstree_item
*
i
)
{
return
(
i
->
state
==
TASK_ALIVE
)
||
(
i
->
state
==
TASK_STOPPED
);
}
extern
void
free_pstree
(
struct
pstree_item
*
root_item
);
extern
void
free_pstree
(
struct
pstree_item
*
root_item
);
extern
struct
pstree_item
*
__alloc_pstree_item
(
bool
rst
);
extern
struct
pstree_item
*
__alloc_pstree_item
(
bool
rst
);
#define alloc_pstree_item() __alloc_pstree_item(false)
#define alloc_pstree_item() __alloc_pstree_item(false)
...
...
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