From 8f44e2151cb3f91b220c4a3393a06068d0ee7302 Mon Sep 17 00:00:00 2001 From: Uros Majstorovic Date: Wed, 16 Aug 2017 21:21:33 +0200 Subject: fixed rbuf; fixed error code for pthread_mitex_init --- code/vconn/vconn.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'code/vconn') diff --git a/code/vconn/vconn.c b/code/vconn/vconn.c index 3a69092..33fa80b 100644 --- a/code/vconn/vconn.c +++ b/code/vconn/vconn.c @@ -471,14 +471,16 @@ int ecp_ctx_vconn_init(ECPContext *ctx) { ctx->pack_raw = vconn_pack_raw; #ifdef ECP_WITH_PTHREAD - pthread_mutex_init(&key_perma_mutex, NULL); - pthread_mutex_init(&key_next_mutex, NULL); + rv = pthread_mutex_init(&key_perma_mutex, NULL); + if (!rv) pthread_mutex_init(&key_next_mutex, NULL); + if (rv) return ECP_ERR; #endif #ifdef ECP_WITH_HTABLE if (ctx->ht.init) { key_perma_table = ctx->ht.create(ctx); key_next_table = ctx->ht.create(ctx); + if ((key_perma_table == NULL) || (key_next_table == NULL)) return ECP_ERR; } #endif -- cgit v1.2.3