From aead1e26d674b58dcfd18c70b7571babfbf9120d Mon Sep 17 00:00:00 2001 From: Cyrill Gorcunov Date: Thu, 11 Oct 2012 17:59:10 +0400 Subject: [PATCH] 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 Signed-off-by: Pavel Emelyanov --- include/parasite-syscall.h | 2 +- parasite-syscall.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/parasite-syscall.h b/include/parasite-syscall.h index 8338d3df8..aad65656d 100644 --- a/include/parasite-syscall.h +++ b/include/parasite-syscall.h @@ -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 */ }; diff --git a/parasite-syscall.c b/parasite-syscall.c index 1118ef2ec..854175377 100644 --- a/parasite-syscall.c +++ b/parasite-syscall.c @@ -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, ®s); @@ -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);