X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Frrd_thread_safe.c;h=46d8cd1e8450d810eba62eb31239cd49f0f510c7;hb=8d278938aef5adefa2915dd446abc028cc764550;hp=3138cc8529ecb6c549645beff2ce74c05d5944a9;hpb=46d2e915a9f864304ee107f9ea35a60b01d3e378;p=rrdtool.git diff --git a/src/rrd_thread_safe.c b/src/rrd_thread_safe.c index 3138cc8..46d8cd1 100644 --- a/src/rrd_thread_safe.c +++ b/src/rrd_thread_safe.c @@ -27,7 +27,7 @@ static pthread_once_t context_key_once = PTHREAD_ONCE_INIT; static void context_destroy_context( void *ctx_) { - struct rrd_context *ctx = ctx_; + rrd_context_t *ctx = ctx_; if (ctx) rrd_free_context(ctx); @@ -40,10 +40,10 @@ static void context_get_key( pthread_key_create(&context_key, context_destroy_context); } -struct rrd_context *rrd_get_context( +rrd_context_t *rrd_get_context( void) { - struct rrd_context *ctx; + rrd_context_t *ctx; pthread_once(&context_key_once, context_get_key); ctx = pthread_getspecific(context_key); @@ -58,7 +58,7 @@ struct rrd_context *rrd_get_context( const char *rrd_strerror( int err) { - struct rrd_context *ctx = rrd_get_context(); + rrd_context_t *ctx = rrd_get_context(); if (strerror_r(err, ctx->lib_errstr, sizeof(ctx->lib_errstr))) return "strerror_r failed. sorry!"; @@ -71,7 +71,7 @@ const char *rrd_strerror( int err) { static pthread_mutex_t mtx = PTHREAD_MUTEX_INITIALIZER; - struct rrd_context *ctx; + rrd_context_t *ctx; ctx = rrd_get_context(); pthread_mutex_lock(&mtx);