mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-22 01:31:34 +00:00
files: Get rid of strict-aliasing violations
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
This commit is contained in:
parent
7050ea2ca8
commit
339ad2d887
1 changed files with 7 additions and 3 deletions
10
files.c
10
files.c
|
|
@ -329,7 +329,8 @@ static int open_fd(int pid, struct fdinfo_entry *fe,
|
|||
struct msghdr hdr;
|
||||
struct iovec data;
|
||||
char cmsgbuf[CMSG_SPACE(sizeof(int))];
|
||||
struct cmsghdr* cmsg;
|
||||
struct cmsghdr *cmsg;
|
||||
int *cmsg_data;
|
||||
|
||||
char dummy = '*';
|
||||
|
||||
|
|
@ -365,7 +366,8 @@ static int open_fd(int pid, struct fdinfo_entry *fe,
|
|||
cmsg->cmsg_level = SOL_SOCKET;
|
||||
cmsg->cmsg_type = SCM_RIGHTS;
|
||||
|
||||
*(int*)CMSG_DATA(cmsg) = fe->addr;
|
||||
cmsg_data = (int *)CMSG_DATA(cmsg);
|
||||
*cmsg_data = fe->addr;
|
||||
|
||||
tmp = sendmsg(sock, &hdr, 0);
|
||||
if (tmp < 0) {
|
||||
|
|
@ -387,6 +389,7 @@ static int recv_fd(int sock)
|
|||
char buf[1];
|
||||
char ccmsg[CMSG_SPACE(sizeof(int))];
|
||||
struct cmsghdr *cmsg;
|
||||
int *cmsg_data;
|
||||
iov.iov_base = buf;
|
||||
iov.iov_len = 1;
|
||||
int ret;
|
||||
|
|
@ -411,7 +414,8 @@ static int recv_fd(int sock)
|
|||
return -1;
|
||||
}
|
||||
|
||||
return *(int*)CMSG_DATA(cmsg);
|
||||
cmsg_data = (int *)CMSG_DATA(cmsg);
|
||||
return *cmsg_data;
|
||||
}
|
||||
|
||||
static int receive_fd(int pid, struct fdinfo_entry *fe, struct fdinfo_desc *fi)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue