From: Gerrie Roos Date: Tue, 20 Dec 2011 04:30:59 +0000 (+0200) Subject: network plugin: Fixed incorrect collectd warning when configuring network plugin. X-Git-Tag: collectd-4.10.6~2 X-Git-Url: https://git.octo.it/?a=commitdiff_plain;h=1c72a0f3c8a52bbbc6916d513bb1c1975abc0f29;p=collectd.git network plugin: Fixed incorrect collectd warning when configuring network plugin. Cosmetic only Change-Id: I4c4c8fe19c23e9aa31b35e61eba31aa686429c10 Signed-off-by: Florian Forster --- diff --git a/src/network.c b/src/network.c index 8de557d2..700b27f0 100644 --- a/src/network.c +++ b/src/network.c @@ -1683,9 +1683,9 @@ static int network_set_interface (const sockent_t *se, const struct addrinfo *ai } /* else: Not a multicast interface. */ -#if defined(HAVE_IF_INDEXTONAME) && HAVE_IF_INDEXTONAME && defined(SO_BINDTODEVICE) if (se->interface != 0) { +#if defined(HAVE_IF_INDEXTONAME) && HAVE_IF_INDEXTONAME && defined(SO_BINDTODEVICE) char interface_name[IFNAMSIZ]; if (if_indextoname (se->interface, interface_name) == NULL) @@ -1702,20 +1702,21 @@ static int network_set_interface (const sockent_t *se, const struct addrinfo *ai sstrerror (errno, errbuf, sizeof (errbuf))); return (-1); } - } /* #endif HAVE_IF_INDEXTONAME && SO_BINDTODEVICE */ #else - WARNING ("network plugin: Cannot set the interface on a unicast " + WARNING ("network plugin: Cannot set the interface on a unicast " "socket because " # if !defined(SO_BINDTODEVICE) - "the the \"SO_BINDTODEVICE\" socket option " + "the \"SO_BINDTODEVICE\" socket option " # else "the \"if_indextoname\" function " # endif "is not available on your system."); #endif + } + return (0); } /* }}} network_set_interface */