projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
virt plugin: Added timeout to event_loop thread
[collectd.git]
/
src
/
teamspeak2.c
diff --git
a/src/teamspeak2.c
b/src/teamspeak2.c
index
ae9200c
..
1ab6e4b
100644
(file)
--- a/
src/teamspeak2.c
+++ b/
src/teamspeak2.c
@@
-23,8
+23,8
@@
#include "collectd.h"
#include "collectd.h"
-#include "common.h"
#include "plugin.h"
#include "plugin.h"
+#include "utils/common/common.h"
#include <arpa/inet.h>
#include <netdb.h>
#include <arpa/inet.h>
#include <netdb.h>
@@
-46,14
+46,14
@@
typedef struct vserver_list_s {
int port;
struct vserver_list_s *next;
} vserver_list_t;
int port;
struct vserver_list_s *next;
} vserver_list_t;
-static vserver_list_t *server_list
= NULL
;
+static vserver_list_t *server_list;
/* Host data */
/* Host data */
-static char *config_host
= NULL
;
-static char *config_port
= NULL
;
+static char *config_host;
+static char *config_port;
-static FILE *global_read_fh
= NULL
;
-static FILE *global_write_fh
= NULL
;
+static FILE *global_read_fh;
+static FILE *global_write_fh;
/* Config data */
static const char *config_keys[] = {"Host", "Port", "Server"};
/* Config data */
static const char *config_keys[] = {"Host", "Port", "Server"};
@@
-255,7
+255,7
@@
static int tss2_get_socket(FILE **ret_read_fh, FILE **ret_write_fh) {
config_host ? config_host : DEFAULT_HOST,
config_port ? config_port : DEFAULT_PORT);
}
config_host ? config_host : DEFAULT_HOST,
config_port ? config_port : DEFAULT_PORT);
}
- buffer[sizeof(buffer) - 1] =
0
;
+ buffer[sizeof(buffer) - 1] =
'\0'
;
if (memcmp("[TS]\r\n", buffer, 6) != 0) {
ERROR("teamspeak2 plugin: Unexpected response when connecting "
if (memcmp("[TS]\r\n", buffer, 6) != 0) {
ERROR("teamspeak2 plugin: Unexpected response when connecting "
@@
-309,7
+309,7
@@
static int tss2_receive_line(FILE *fh, char *buffer, int buffer_size) {
return -1;
}
return -1;
}
- buffer[buffer_size - 1] =
0
;
+ buffer[buffer_size - 1] =
'\0'
;
return 0;
} /* int tss2_receive_line */
return 0;
} /* int tss2_receive_line */
@@
-337,7
+337,7
@@
static int tss2_select_vserver(FILE *read_fh, FILE *write_fh,
ERROR("teamspeak2 plugin: tss2_receive_line failed.");
return -1;
}
ERROR("teamspeak2 plugin: tss2_receive_line failed.");
return -1;
}
- response[sizeof(response) - 1] =
0
;
+ response[sizeof(response) - 1] =
'\0'
;
/* Check answer */
if ((strncasecmp("OK", response, 2) == 0) &&
/* Check answer */
if ((strncasecmp("OK", response, 2) == 0) &&
@@
-379,7
+379,7
@@
static int tss2_vserver_gapl(FILE *read_fh, FILE *write_fh,
ERROR("teamspeak2 plugin: tss2_receive_line failed.");
return -1;
}
ERROR("teamspeak2 plugin: tss2_receive_line failed.");
return -1;
}
- buffer[sizeof(buffer) - 1] =
0
;
+ buffer[sizeof(buffer) - 1] =
'\0'
;
if (strncmp("average_packet_loss=", buffer,
strlen("average_packet_loss=")) == 0) {
if (strncmp("average_packet_loss=", buffer,
strlen("average_packet_loss=")) == 0) {