[vte] Bug 620493 - strict aliasing warning



commit b86c068b061090e176b1ff6e82dcccfd0198ed2f
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu Jun 3 12:16:30 2010 -0400

    Bug 620493 - strict aliasing warning

 gnome-pty-helper/gnome-pty-helper.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/gnome-pty-helper/gnome-pty-helper.c b/gnome-pty-helper/gnome-pty-helper.c
index 130cc24..2666bf4 100644
--- a/gnome-pty-helper/gnome-pty-helper.c
+++ b/gnome-pty-helper/gnome-pty-helper.c
@@ -113,6 +113,7 @@ pass_fd (int client_fd, int fd)
         char          buf [1];
         char    cmsgbuf[CMSG_SPACE(sizeof(int))];
         struct  cmsghdr *cmptr;
+        int *fdptr;
 
 	iov [0].iov_base = buf;
 	iov [0].iov_len  = 1;
@@ -128,8 +129,8 @@ pass_fd (int client_fd, int fd)
 	cmptr->cmsg_level = SOL_SOCKET;
 	cmptr->cmsg_type  = SCM_RIGHTS;
 	cmptr->cmsg_len   = CMSG_LEN(sizeof(int));
-	*(int *)CMSG_DATA (cmptr) = fd;
-
+        fdptr = (int *) CMSG_DATA(cmptr);
+        memcpy (fdptr, &fd, sizeof(int));
 	if (sendmsg (client_fd, &msg, 0) != 1)
 		return -1;
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]