Update error check for root handle
[lttng-ust.git] / tests / ust-basic-tracing / ust-basic-tracing.c
index 437b9c24c7fdd0e299673a95e4df8bf8d8891ee4..8e0847fa41c5828828bc9e0a6d94872402b441bb 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)[i];
+       ret = tmp.vi;
        printf("received fd %d\n", ret);
 end:
        return ret;
@@ -810,7 +817,7 @@ int main(int argc, const char **argv)
        const char *home_dir;
        int ret, wait_shm_fd;
        struct sigaction act;
-       mode_t old_umask;
+       mode_t old_umask = 0;
        const char *outputpath;
        const char **event_names;
        unsigned int nr_events;
This page took 0.0247 seconds and 4 git commands to generate.