This patch fixes the following Coverity complaint:
CID 280680 (#1 of 1): Unchecked return value (CHECKED_RETURN)
5. check_return: Calling pthread_detach without checking return value (as is done elsewhere 4 out of 5 times).
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
pthread_cond_signal(&rt->thread.cond);
} else {
int ret = pthread_create(&work->thread, NULL, reader_one_off, work);
- if (ret)
+ if (ret) {
fprintf(stderr, "pthread_create=%d\n", ret);
- else
- pthread_detach(work->thread);
+ } else {
+ ret = pthread_detach(work->thread);
+ if (ret)
+ fprintf(stderr, "pthread_detach=%d\n", ret);
+ }
}
}