Cleanup: fix strict aliasing ion tests
[ust.git] / tests / ust-basic-tracing / ust-basic-tracing.c
index a2f75d4e7c590acc1e13fcfffb6dddb141f3de88..583179c1e9b03354a20fe51fbe73179df4703840 100644 (file)
@@ -159,6 +159,11 @@ static int lttcomm_recv_fd(int sock)
        struct cmsghdr *cmsg;
        char recv_fd[CMSG_SPACE(sizeof(int))];
        struct msghdr msg = { 0 };
+       union {
+               unsigned char vc[4];
+               int vi;
+       } tmp;
+       int i;
 
        /* Prepare to receive the structures */
        iov[0].iov_base = &data_fd;
@@ -189,7 +194,9 @@ static int lttcomm_recv_fd(int sock)
                goto end;
        }
        /* this is our fd */
-       ret = ((int *) CMSG_DATA(cmsg))[0];
+       for (i = 0; i < sizeof(int); i++)
+               tmp.vc[i] = CMSG_DATA(cmsg)[0];
+       ret = tmp.vi;
        printf("received fd %d\n", ret);
 end:
        return ret;
This page took 0.022808 seconds and 4 git commands to generate.