diff options
author | Volker Lendecke <vl@samba.org> | 2012-03-31 10:37:15 +0200 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2012-03-31 13:51:17 +0200 |
commit | aef86982b845072d8624294f5c557eb315740467 (patch) | |
tree | ce3d979f916732d9e42359cf8394dcc10d8e3585 /source3/modules | |
parent | 7d3c26e8cfcffb519990d5d2d70af3307e34c15f (diff) | |
download | samba-aef86982b845072d8624294f5c557eb315740467.tar.gz samba-aef86982b845072d8624294f5c557eb315740467.tar.bz2 samba-aef86982b845072d8624294f5c557eb315740467.zip |
s3-aio-fork: Fix an alignment warning on OS/X
Diffstat (limited to 'source3/modules')
-rw-r--r-- | source3/modules/vfs_aio_fork.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source3/modules/vfs_aio_fork.c b/source3/modules/vfs_aio_fork.c index 27f71165cf..16a1301c5e 100644 --- a/source3/modules/vfs_aio_fork.c +++ b/source3/modules/vfs_aio_fork.c @@ -165,7 +165,7 @@ static ssize_t read_fd(int fd, void *ptr, size_t nbytes, int *recvfd) errno = EINVAL; return -1; } - *recvfd = *((int *) CMSG_DATA(cmptr)); + memcpy(recvfd, CMSG_DATA(cmptr), sizeof(*recvfd)); } else { *recvfd = -1; /* descriptor was not passed */ } @@ -203,7 +203,7 @@ static ssize_t write_fd(int fd, void *ptr, size_t nbytes, int sendfd) cmptr->cmsg_len = CMSG_LEN(sizeof(int)); cmptr->cmsg_level = SOL_SOCKET; cmptr->cmsg_type = SCM_RIGHTS; - *((int *) CMSG_DATA(cmptr)) = sendfd; + memcpy(CMSG_DATA(cmptr), &sendfd, sizeof(sendfd)); #else ZERO_STRUCT(msg); msg.msg_accrights = (caddr_t) &sendfd; |