projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix typographical mistake in warning message
[collectd.git]
/
src
/
mbmon.c
diff --git
a/src/mbmon.c
b/src/mbmon.c
index
1f0a0d6
..
184bb99
100644
(file)
--- a/
src/mbmon.c
+++ b/
src/mbmon.c
@@
-24,6
+24,7
@@
**/
#include "collectd.h"
**/
#include "collectd.h"
+
#include "common.h"
#include "plugin.h"
#include "configfile.h"
#include "common.h"
#include "plugin.h"
#include "configfile.h"
@@
-84,7
+85,7
@@
static int mbmon_query_daemon (char *buffer, int buffer_size)
const char *host;
const char *port;
const char *host;
const char *port;
- struct addrinfo *ai_list
, *ai_ptr
;
+ struct addrinfo *ai_list;
int ai_return;
host = mbmon_host;
int ai_return;
host = mbmon_host;
@@
-96,7
+97,7
@@
static int mbmon_query_daemon (char *buffer, int buffer_size)
port = MBMON_DEF_PORT;
struct addrinfo ai_hints = {
port = MBMON_DEF_PORT;
struct addrinfo ai_hints = {
- .ai_family =
P
F_UNSPEC,
+ .ai_family =
A
F_UNSPEC,
.ai_flags = AI_ADDRCONFIG,
.ai_protocol = IPPROTO_TCP,
.ai_socktype = SOCK_STREAM
.ai_flags = AI_ADDRCONFIG,
.ai_protocol = IPPROTO_TCP,
.ai_socktype = SOCK_STREAM
@@
-114,7
+115,7
@@
static int mbmon_query_daemon (char *buffer, int buffer_size)
}
fd = -1;
}
fd = -1;
- for (ai_ptr = ai_list; ai_ptr != NULL; ai_ptr = ai_ptr->ai_next)
+ for (
struct addrinfo *
ai_ptr = ai_list; ai_ptr != NULL; ai_ptr = ai_ptr->ai_next)
{
/* create our socket descriptor */
if ((fd = socket (ai_ptr->ai_family, ai_ptr->ai_socktype, ai_ptr->ai_protocol)) < 0)
{
/* create our socket descriptor */
if ((fd = socket (ai_ptr->ai_family, ai_ptr->ai_socktype, ai_ptr->ai_protocol)) < 0)
@@
-236,9
+237,7
@@
static void mbmon_submit (const char *type, const char *type_instance,
/* Trim trailing whitespace from a string. */
static void trim_spaces (char *s)
{
/* Trim trailing whitespace from a string. */
static void trim_spaces (char *s)
{
- size_t l;
-
- for (l = strlen (s) - 1; (l > 0) && isspace ((int) s[l]); l--)
+ for (size_t l = strlen (s) - 1; (l > 0) && isspace ((int) s[l]); l--)
s[l] = '\0';
}
s[l] = '\0';
}