Cleanup: fix strict aliasing ion tests
[ust.git] / tests / ust-multi-test / ust-multi-test.c
index 2737c18fe15eb3dc01d66953a977a51d5dae1c5f..c4b4f212973958664d69592232542e9ec8470394 100644 (file)
@@ -167,6 +167,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;
@@ -197,7 +202,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.022759 seconds and 4 git commands to generate.