2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-30 05:48:05 +00:00

parasite: Simplify parasite command copying

No need for memcpy here, it's plain integer value
which need to be filled.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Cyrill Gorcunov 2012-10-11 17:59:10 +04:00 committed by Pavel Emelyanov
parent 9929d2efdf
commit aead1e26d6
2 changed files with 3 additions and 3 deletions

View File

@ -17,7 +17,7 @@ struct parasite_ctl {
int signals_blocked;
void * addr_cmd; /* addr for command */
unsigned int * addr_cmd; /* addr for command */
void * addr_args; /* address for arguments */
int tsock; /* transport socket for transfering fds */
};

View File

@ -244,7 +244,7 @@ static int parasite_execute_by_pid(unsigned int cmd, struct parasite_ctl *ctl, p
regs = regs_orig;
}
memcpy(ctl->addr_cmd, &cmd, sizeof(cmd));
*ctl->addr_cmd = cmd;
parasite_setup_regs(ctl->parasite_ip, &regs);
@ -807,7 +807,7 @@ struct parasite_ctl *parasite_infect_seized(pid_t pid, struct list_head *vma_are
/* Setup the rest of a control block */
ctl->parasite_ip = PARASITE_HEAD_ADDR((unsigned long)ctl->remote_map);
ctl->addr_cmd = (void *)PARASITE_CMD_ADDR((unsigned long)ctl->local_map);
ctl->addr_cmd = (unsigned int *)PARASITE_CMD_ADDR((unsigned long)ctl->local_map);
ctl->addr_args = (void *)PARASITE_ARGS_ADDR((unsigned long)ctl->local_map);
ret = parasite_init(ctl, pid);