Commit 9508e39e authored by Andrey Vagin's avatar Andrey Vagin Committed by Pavel Emelyanov

crtools: use pit_t for PIDs

Here is a bit mess, because we used unsigned int instead of pid_t.
A negative value is used for uninitialized PID's variables.
Signed-off-by: 's avatarAndrey Vagin <avagin@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 7a65c701
......@@ -954,11 +954,11 @@ static int check_threads(const struct pstree_item *item)
return 0;
}
static int parse_children(int pid, u32 **_c, int *_n)
static int parse_children(pid_t pid, pid_t **_c, int *_n)
{
FILE *file;
char *tok;
u32 *ch = NULL;
pid_t *ch = NULL;
int nr = 1;
DIR *dir;
struct dirent *de;
......@@ -984,7 +984,7 @@ static int parse_children(int pid, u32 **_c, int *_n)
tok = strtok(loc_buf, " \n");
while (tok) {
u32 *tmp = xrealloc(ch, nr * sizeof(u32));
pid_t *tmp = xrealloc(ch, nr * sizeof(pid_t));
if (!tmp)
goto err;
ch = tmp;
......@@ -1008,7 +1008,7 @@ err:
static int get_children(struct pstree_item *item)
{
u32 *ch;
pid_t *ch;
int ret, i, nr_children;
struct pstree_item *c;
......@@ -1150,7 +1150,7 @@ err:
static int check_subtree(const struct pstree_item *item)
{
u32 *ch;
pid_t *ch;
int nr, ret, i;
struct pstree_item *child;
......
......@@ -203,8 +203,8 @@ struct rst_info {
struct pid
{
u32 real; /* used to peek/poke tasks during dump stage */
u32 virt; /* used all over in the images and saved after restore */
pid_t real; /* used to peek/poke tasks during dump stage */
pid_t virt; /* used all over in the images and saved after restore */
};
static inline int in_vma_area(struct vma_area *vma, unsigned long addr)
......
......@@ -35,7 +35,7 @@ extern int parasite_dump_pages_seized(struct parasite_ctl *ctl,
struct cr_fdset *cr_fdset);
struct parasite_dump_tid_info;
extern int parasite_dump_thread_seized(struct parasite_ctl *ctl, pid_t pid,
unsigned int **tid_add, u32 *tid);
unsigned int **tid_add, pid_t *tid);
struct parasite_drain_fd;
struct fd_opts;
......
......@@ -435,7 +435,7 @@ err:
}
int parasite_dump_thread_seized(struct parasite_ctl *ctl, pid_t pid,
unsigned int **tid_addr, u32 *tid)
unsigned int **tid_addr, pid_t *tid)
{
struct parasite_dump_tid_info args = { };
int ret;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment