From: Florian Forster Date: Fri, 2 Sep 2016 06:23:27 +0000 (+0200) Subject: ceph plugin: Ensure that at least one daemon is configured in cconn_main_loop(). X-Git-Tag: collectd-5.7.0~115 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=dc3ddbb1377988f1335237ca68123671521f33cf;p=collectd.git ceph plugin: Ensure that at least one daemon is configured in cconn_main_loop(). This addresses a scan-build issue. --- diff --git a/src/ceph.c b/src/ceph.c index e6d3767b..ad0688cc 100644 --- a/src/ceph.c +++ b/src/ceph.c @@ -1468,6 +1468,12 @@ static int cconn_main_loop(uint32_t request_type) struct timeval end_tv; struct cconn io_array[g_num_daemons]; + if (g_num_daemons < 1) + { + ERROR ("ceph plugin: No daemons configured. See the \"Daemon\" config option."); + return ENOENT; + } + DEBUG("ceph plugin: entering cconn_main_loop(request_type = %d)", request_type); /* create cconn array */