projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix double declaration
[collectd.git]
/
src
/
postgresql.c
diff --git
a/src/postgresql.c
b/src/postgresql.c
index
b4b4ca7
..
65766a9
100644
(file)
--- a/
src/postgresql.c
+++ b/
src/postgresql.c
@@
-40,10
+40,6
@@
#include "utils_db_query.h"
#include "utils_complain.h"
#include "utils_db_query.h"
#include "utils_complain.h"
-#if HAVE_PTHREAD_H
-# include <pthread.h>
-#endif
-
#include <pg_config_manual.h>
#include <libpq-fe.h>
#include <pg_config_manual.h>
#include <libpq-fe.h>
@@
-224,7
+220,7
@@
static c_psql_database_t *c_psql_database_new (const char *name)
return NULL;
}
return NULL;
}
- tmp =
(c_psql_database_t **)
realloc (databases,
+ tmp = realloc (databases,
(databases_num + 1) * sizeof (*databases));
if (NULL == tmp) {
log_err ("Out of memory.");
(databases_num + 1) * sizeof (*databases));
if (NULL == tmp) {
log_err ("Out of memory.");
@@
-1115,7
+1111,7
@@
static int config_add_writer (oconfig_item_t *ci,
if (strcasecmp (name, src_writers[i].name) != 0)
continue;
if (strcasecmp (name, src_writers[i].name) != 0)
continue;
- tmp =
(c_psql_writer_t **)
realloc (*dst_writers,
+ tmp = realloc (*dst_writers,
sizeof (**dst_writers) * (*dst_writers_num + 1));
if (tmp == NULL) {
log_err ("Out of memory.");
sizeof (**dst_writers) * (*dst_writers_num + 1));
if (tmp == NULL) {
log_err ("Out of memory.");
@@
-1151,7
+1147,7
@@
static int c_psql_config_writer (oconfig_item_t *ci)
return 1;
}
return 1;
}
- tmp =
(c_psql_writer_t *)
realloc (writers,
+ tmp = realloc (writers,
sizeof (*writers) * (writers_num + 1));
if (tmp == NULL) {
log_err ("Out of memory.");
sizeof (*writers) * (writers_num + 1));
if (tmp == NULL) {
log_err ("Out of memory.");
@@
-1192,7
+1188,7
@@
static int c_psql_config_database (oconfig_item_t *ci)
c_psql_database_t *db;
char cb_name[DATA_MAX_NAME_LEN];
c_psql_database_t *db;
char cb_name[DATA_MAX_NAME_LEN];
- user_data_t ud;
+ user_data_t ud
= { 0 }
;
static _Bool have_flush = 0;
static _Bool have_flush = 0;
@@
-1204,8
+1200,6
@@
static int c_psql_config_database (oconfig_item_t *ci)
return 1;
}
return 1;
}
- memset (&ud, 0, sizeof (ud));
-
db = c_psql_database_new (ci->values[0].value.string);
if (db == NULL)
return -1;
db = c_psql_database_new (ci->values[0].value.string);
if (db == NULL)
return -1;