From: Florian Forster Date: Thu, 21 Sep 2017 15:26:23 +0000 (+0200) Subject: Merge branch 'collectd-5.7' X-Git-Tag: collectd-5.8.0~90 X-Git-Url: https://git.octo.it/?a=commitdiff_plain;h=1b10ab706f8b70ce2f086e59a54cc09d671ad989;hp=47fd864adf60f70628e516d933c859229ff70912;p=collectd.git Merge branch 'collectd-5.7' --- diff --git a/contrib/redhat/collectd.spec b/contrib/redhat/collectd.spec index 66d1914e..23cac9a0 100644 --- a/contrib/redhat/collectd.spec +++ b/contrib/redhat/collectd.spec @@ -521,8 +521,8 @@ the byte- and packet-counters of selected rules and submit them to collectd. Summary: Java plugin for collectd Group: System Environment/Daemons Requires: %{name}%{?_isa} = %{version}-%{release} -BuildRequires: java-devel, jpackage-utils -Requires: java, jpackage-utils +BuildRequires: java-devel >= 1.6, jpackage-utils >= 1.6 +Requires: java >= 1.6, jpackage-utils >= 1.6 %description java This plugin for collectd allows plugins to be written in Java and executed in an embedded JVM. diff --git a/src/network.c b/src/network.c index 375da847..4e684215 100644 --- a/src/network.c +++ b/src/network.c @@ -1230,9 +1230,9 @@ static int parse_part_encr_aes256(sockent_t *se, /* {{{ */ part_size - buffer_offset, /* in = */ NULL, /* in len = */ 0); if (err != 0) { - sfree(pea.username); ERROR("network plugin: gcry_cipher_decrypt returned: %s. Username: %s", gcry_strerror(err), pea.username); + sfree(pea.username); return -1; } @@ -1254,8 +1254,6 @@ static int parse_part_encr_aes256(sockent_t *se, /* {{{ */ parse_packet(se, buffer + buffer_offset, payload_len, flags | PP_ENCRYPTED, pea.username); - /* XXX: Free pea.username?!? */ - /* Update return values */ *ret_buffer = buffer + part_size; *ret_buffer_len = buffer_len - part_size; @@ -2652,10 +2650,10 @@ static int network_write(const data_set_t *ds, const value_list_t *vl, pthread_mutex_lock(&send_buffer_lock); - status = add_to_buffer(send_buffer_ptr, - network_config_packet_size - - (send_buffer_fill + BUFF_SIG_SIZE), - &send_buffer_vl, ds, vl); + status = + add_to_buffer(send_buffer_ptr, network_config_packet_size - + (send_buffer_fill + BUFF_SIG_SIZE), + &send_buffer_vl, ds, vl); if (status >= 0) { /* status == bytes added to the buffer */ send_buffer_fill += status; @@ -2666,10 +2664,10 @@ static int network_write(const data_set_t *ds, const value_list_t *vl, } else { flush_buffer(); - status = add_to_buffer(send_buffer_ptr, - network_config_packet_size - - (send_buffer_fill + BUFF_SIG_SIZE), - &send_buffer_vl, ds, vl); + status = + add_to_buffer(send_buffer_ptr, network_config_packet_size - + (send_buffer_fill + BUFF_SIG_SIZE), + &send_buffer_vl, ds, vl); if (status >= 0) { send_buffer_fill += status; diff --git a/src/ntpd.c b/src/ntpd.c index a19d05c1..48d7aa72 100644 --- a/src/ntpd.c +++ b/src/ntpd.c @@ -846,9 +846,9 @@ static int ntpd_read(void) { } /* kerninfo -> estimated error */ - offset_loop = scale_loop * ((gauge_t)ntohl(ik->offset)); + offset_loop = (gauge_t)((int32_t)ntohl(ik->offset) * scale_loop); freq_loop = ntpd_read_fp(ik->freq); - offset_error = scale_error * ((gauge_t)ntohl(ik->esterror)); + offset_error = (gauge_t)((int32_t)ntohl(ik->esterror) * scale_error); DEBUG("info_kernel:\n" " pll offset = %.8g\n" diff --git a/src/perl.c b/src/perl.c index a1ac8d76..d2a00bfd 100644 --- a/src/perl.c +++ b/src/perl.c @@ -2616,6 +2616,12 @@ static int perl_config_plugin(pTHX_ oconfig_item_t *ci) { char *plugin; HV *config; + if (NULL == perl_threads) { + log_err("A `Plugin' block was encountered but no plugin was loaded yet. " + "Put the appropriate `LoadPlugin' option in front of it."); + return -1; + } + dSP; if ((1 != ci->values_num) || (OCONFIG_TYPE_STRING != ci->values[0].type)) {