Tests: unchecked pthread_join return value
[lttng-tools.git] / tests / regression / kernel / select_poll_epoll.c
index 2a69d5e452d8d42b36cfa2e0d24be96b5e420d48..cb39b08191b41701a9bb299cd2c414203499dcc3 100644 (file)
@@ -655,7 +655,11 @@ void stress_ppoll(int *fds, int value)
                do_ppoll(fds, ufds);
        }
        stop_thread = 1;
-       pthread_join(writer, NULL);
+       ret = pthread_join(writer, NULL);
+       if (ret) {
+               fprintf(stderr, "[error] pthread_join\n");
+               goto end;
+       }
 end:
        return;
 }
@@ -751,7 +755,12 @@ void epoll_pwait_concurrent_munmap(void)
                }
        }
        stop_thread = 0;
-       pthread_create(&writer, NULL, &epoll_pwait_writer, (void *) epoll_event);
+       ret = pthread_create(&writer, NULL, &epoll_pwait_writer,
+                       (void *) epoll_event);
+       if (ret != 0) {
+               fprintf(stderr, "[error] pthread_create\n");
+               goto end;
+       }
 
        ret = epoll_pwait(epollfd, epoll_event, 1, 1, NULL);
 
@@ -768,8 +777,11 @@ void epoll_pwait_concurrent_munmap(void)
        }
 
        stop_thread = 1;
-       pthread_join(writer, NULL);
-
+       ret = pthread_join(writer, NULL);
+       if (ret) {
+               fprintf(stderr, "[error] pthread_join\n");
+               goto end_unmap;
+       }
 end_unmap:
        for (i = 0; i < MAX_FDS; i++) {
                ret = close(fds[i]);
This page took 0.025489 seconds and 4 git commands to generate.