Deleted Added
full compact
1c1
< /* $FreeBSD: head/lib/libusb/libusb10.c 234684 2012-04-25 17:54:26Z hselasky $ */
---
> /* $FreeBSD: head/lib/libusb/libusb10.c 236944 2012-06-12 07:28:25Z hselasky $ */
94a95
> pthread_condattr_t attr;
113,114c114,135
< pthread_mutex_init(&ctx->ctx_lock, NULL);
< pthread_cond_init(&ctx->ctx_cond, NULL);
---
> if (pthread_mutex_init(&ctx->ctx_lock, NULL) != 0) {
> free(ctx);
> return (LIBUSB_ERROR_NO_MEM);
> }
> if (pthread_condattr_init(&attr) != 0) {
> pthread_mutex_destroy(&ctx->ctx_lock);
> free(ctx);
> return (LIBUSB_ERROR_NO_MEM);
> }
> if (pthread_condattr_setclock(&attr, CLOCK_MONOTONIC) != 0) {
> pthread_mutex_destroy(&ctx->ctx_lock);
> pthread_condattr_destroy(&attr);
> free(ctx);
> return (LIBUSB_ERROR_OTHER);
> }
> if (pthread_cond_init(&ctx->ctx_cond, &attr) != 0) {
> pthread_mutex_destroy(&ctx->ctx_lock);
> pthread_condattr_destroy(&attr);
> free(ctx);
> return (LIBUSB_ERROR_NO_MEM);
> }
> pthread_condattr_destroy(&attr);