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
15999f6b
Commit
15999f6b
authored
Jan 18, 2013
by
Pavel Emelyanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ids: Split routine that dumps task's IDs
Signed-off-by:
Pavel Emelyanov
<
xemul@parallels.com
>
parent
2105e18e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
3 deletions
+25
-3
cr-dump.c
cr-dump.c
+23
-3
pstree.h
include/pstree.h
+2
-0
No files found.
cr-dump.c
View file @
15999f6b
...
@@ -899,14 +899,14 @@ err:
...
@@ -899,14 +899,14 @@ err:
return
NULL
;
return
NULL
;
}
}
static
int
dump_task_ids
(
struct
pstree_item
*
item
,
const
struct
cr_fdset
*
cr_fdset
)
int
get_task_ids
(
struct
pstree_item
*
item
)
{
{
int
fd_ids
=
fdset_fd
(
cr_fdset
,
CR_FD_IDS
);
int
ret
;
int
ret
;
item
->
ids
=
xmalloc
(
sizeof
(
*
item
->
ids
));
item
->
ids
=
xmalloc
(
sizeof
(
*
item
->
ids
));
if
(
!
item
->
ids
)
if
(
!
item
->
ids
)
return
-
1
;
goto
err
;
task_kobj_ids_entry__init
(
item
->
ids
);
task_kobj_ids_entry__init
(
item
->
ids
);
ret
=
dump_task_kobj_ids
(
item
);
ret
=
dump_task_kobj_ids
(
item
);
...
@@ -917,6 +917,25 @@ static int dump_task_ids(struct pstree_item *item, const struct cr_fdset *cr_fds
...
@@ -917,6 +917,25 @@ static int dump_task_ids(struct pstree_item *item, const struct cr_fdset *cr_fds
if
(
ret
)
if
(
ret
)
goto
err_free
;
goto
err_free
;
return
0
;
err_free:
xfree
(
item
->
ids
);
item
->
ids
=
NULL
;
err:
return
-
1
;
}
static
int
dump_task_ids
(
struct
pstree_item
*
item
,
const
struct
cr_fdset
*
cr_fdset
)
{
int
fd_ids
;
int
ret
;
ret
=
get_task_ids
(
item
);
if
(
ret
)
goto
err
;
fd_ids
=
fdset_fd
(
cr_fdset
,
CR_FD_IDS
);
ret
=
pb_write_one
(
fd_ids
,
item
->
ids
,
PB_IDS
);
ret
=
pb_write_one
(
fd_ids
,
item
->
ids
,
PB_IDS
);
if
(
ret
<
0
)
if
(
ret
<
0
)
goto
err_free
;
goto
err_free
;
...
@@ -926,6 +945,7 @@ static int dump_task_ids(struct pstree_item *item, const struct cr_fdset *cr_fds
...
@@ -926,6 +945,7 @@ static int dump_task_ids(struct pstree_item *item, const struct cr_fdset *cr_fds
err_free:
err_free:
xfree
(
item
->
ids
);
xfree
(
item
->
ids
);
item
->
ids
=
NULL
;
item
->
ids
=
NULL
;
err:
return
-
1
;
return
-
1
;
}
}
...
...
include/pstree.h
View file @
15999f6b
...
@@ -73,4 +73,6 @@ extern bool pid_in_pstree(pid_t pid);
...
@@ -73,4 +73,6 @@ extern bool pid_in_pstree(pid_t pid);
struct
task_entries
;
struct
task_entries
;
extern
struct
task_entries
*
task_entries
;
extern
struct
task_entries
*
task_entries
;
int
get_task_ids
(
struct
pstree_item
*
);
#endif
/* __CR_PSTREE_H__ */
#endif
/* __CR_PSTREE_H__ */
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