[CRIU] [PATCH] parasite: Simplify parasite command copying

Cyrill Gorcunov gorcunov at openvz.org
Thu Oct 11 09:59:29 EDT 2012


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

Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 parasite-syscall.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/parasite-syscall.c b/parasite-syscall.c
index 1118ef2..97eef7a 100644
--- a/parasite-syscall.c
+++ b/parasite-syscall.c
@@ -244,7 +244,8 @@ static int parasite_execute_by_pid(unsigned int cmd, struct parasite_ctl *ctl, p
 		regs = regs_orig;
 	}
 
-	memcpy(ctl->addr_cmd, &cmd, sizeof(cmd));
+	/* Setup command */
+	*(unsigned int *)ctl->addr_cmd = cmd;
 
 	parasite_setup_regs(ctl->parasite_ip, &regs);
 
-- 
1.7.7.6



More information about the CRIU mailing list