From b7e942f07f8cc3b4915aa95477aead8b5a372879 Mon Sep 17 00:00:00 2001 From: Pavel Rochnyack Date: Sat, 29 Oct 2016 18:25:15 +0600 Subject: [PATCH] openvpn: Fixed openvpn_read() on empty configuration. When plugin loaded without configuration, it starts to spam logs with message 'read-function of plugin `openvpn' failed'. Issue: #1932 --- src/openvpn.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/openvpn.c b/src/openvpn.c index 00ae736a..be9a4dc8 100644 --- a/src/openvpn.c +++ b/src/openvpn.c @@ -525,6 +525,9 @@ static int openvpn_read (void) int read; read = 0; + + if (vpn_num == 0) + return (0); /* call the right read function for every status entry in the list */ for (int i = 0; i < vpn_num; i++) @@ -659,8 +662,8 @@ static int openvpn_config (const char *key, const char *value) if (status_version == 0) { - WARNING ("openvpn plugin: unable to detect status version, \ - discarding status file \"%s\".", value); + WARNING ("openvpn plugin: unable to detect status version, " + "discarding status file \"%s\".", value); return (1); } -- 2.11.0