X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=tests%2Fust-basic-tracing%2Fust-basic-tracing.c;h=8e0847fa41c5828828bc9e0a6d94872402b441bb;hb=a51070bbd35a914f8bf83d774ea92c23e3e059b4;hp=437b9c24c7fdd0e299673a95e4df8bf8d8891ee4;hpb=b0a99af43c7ab2159f14adc4e6f382bb56612286;p=lttng-ust.git diff --git a/tests/ust-basic-tracing/ust-basic-tracing.c b/tests/ust-basic-tracing/ust-basic-tracing.c index 437b9c24..8e0847fa 100644 --- a/tests/ust-basic-tracing/ust-basic-tracing.c +++ b/tests/ust-basic-tracing/ust-basic-tracing.c @@ -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;