X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Futils_rrdcreate.c;h=ce7838d540f3c1eb3d2ba4ee657afd38ca4d55a1;hb=e88eef3544bd1cd44463dafda9ac72cc329d508c;hp=87ad968d5f7c756610397dae6beb7a53a3a2b4b7;hpb=0b7cd83a5e6bac068ea83a88a5ddcfb07c09fbec;p=collectd.git diff --git a/src/utils_rrdcreate.c b/src/utils_rrdcreate.c index 87ad968d..ce7838d5 100644 --- a/src/utils_rrdcreate.c +++ b/src/utils_rrdcreate.c @@ -61,7 +61,7 @@ static int rra_types_num = STATIC_ARRAY_SIZE(rra_types); static pthread_mutex_t librrd_lock = PTHREAD_MUTEX_INITIALIZER; #endif -static async_create_file_t *async_creation_list = NULL; +static async_create_file_t *async_creation_list; static pthread_mutex_t async_creation_lock = PTHREAD_MUTEX_INITIALIZER; /* @@ -285,11 +285,11 @@ static int ds_get(char ***ret, /* {{{ */ } else snprintf(max, sizeof(max), "%f", d->max); - status = snprintf(buffer, sizeof(buffer), "DS:%s:%s:%i:%s:%s", d->name, - type, (cfg->heartbeat > 0) - ? cfg->heartbeat - : (int)CDTIME_T_TO_TIME_T(2 * vl->interval), - min, max); + status = snprintf( + buffer, sizeof(buffer), "DS:%s:%s:%i:%s:%s", d->name, type, + (cfg->heartbeat > 0) ? cfg->heartbeat + : (int)CDTIME_T_TO_TIME_T(2 * vl->interval), + min, max); if ((status < 1) || ((size_t)status >= sizeof(buffer))) break; @@ -556,9 +556,7 @@ static int srrd_create_async(const char *filename, /* {{{ */ status = pthread_create(&thread, &attr, srrd_create_thread, args); if (status != 0) { - char errbuf[1024]; - ERROR("srrd_create_async: pthread_create failed: %s", - sstrerror(status, errbuf, sizeof(errbuf))); + ERROR("srrd_create_async: pthread_create failed: %s", STRERROR(status)); pthread_attr_destroy(&attr); srrd_create_args_destroy(args); return status;