summaryrefslogtreecommitdiffstats
path: root/ulogd/mysql/ulogd_MYSQL.c
diff options
context:
space:
mode:
authorlaforge <laforge>2003-08-23 17:37:53 +0000
committerlaforge <laforge>2003-08-23 17:37:53 +0000
commit0278ee5f0443a283b2b6f6f70e19781e00f46d7e (patch)
tree8af743b53cbbc157db8e184b8cc8fe9d7955aa8c /ulogd/mysql/ulogd_MYSQL.c
parent77a62111e3dc548ac6cf10e95668bd9e8d1688b0 (diff)
remove unused functions/variables, fix wrong printf paramtypes (-Wall)
Diffstat (limited to 'ulogd/mysql/ulogd_MYSQL.c')
-rw-r--r--ulogd/mysql/ulogd_MYSQL.c28
1 files changed, 7 insertions, 21 deletions
diff --git a/ulogd/mysql/ulogd_MYSQL.c b/ulogd/mysql/ulogd_MYSQL.c
index 1beba4c..48bb8d6 100644
--- a/ulogd/mysql/ulogd_MYSQL.c
+++ b/ulogd/mysql/ulogd_MYSQL.c
@@ -1,4 +1,4 @@
-/* ulogd_MYSQL.c, Version $Revision: 1.11 $
+/* ulogd_MYSQL.c, Version $Revision: 1.12 $
*
* ulogd output plugin for logging to a MySQL database
*
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id: ulogd_MYSQL.c,v 1.11 2003/08/23 11:40:54 laforge Exp $
+ * $Id: ulogd_MYSQL.c,v 1.12 2003/08/23 11:47:32 laforge Exp $
*
* 15 May 2001, Alex Janssen <alex@ynfonatic.de>:
* Added a compability option for older MySQL-servers, which
@@ -85,26 +85,12 @@ static config_entry_t table_ce = { &pass_ce, "mysqltable", CONFIG_TYPE_STRING,
CONFIG_OPT_MANDATORY, 0,
{ } };
-/* is the given string a field in our table? */
-static int is_field(const char *name)
-{
- struct _field *f;
-
- for (f = fields; f; f = f->next) {
- if (!strcmp(f->name, name))
- return 1;
- }
- return 0;
-}
-
/* our main output function, called by ulogd */
static int _mysql_output(ulog_iret_t *result)
{
struct _field *f;
ulog_iret_t *res;
- char *tmpstr;
-
stmt_ins = stmt_val;
for (f = fields; f; f = f->next) {
@@ -133,7 +119,7 @@ static int _mysql_output(ulog_iret_t *result)
sprintf(stmt_ins, "%d,", res->value.i32);
break;
case ULOGD_RET_INT64:
- sprintf(stmt_ins, "%ld,", res->value.i64);
+ sprintf(stmt_ins, "%lld,", res->value.i64);
break;
case ULOGD_RET_UINT8:
sprintf(stmt_ins, "%u,", res->value.ui8);
@@ -163,7 +149,7 @@ static int _mysql_output(ulog_iret_t *result)
sprintf(stmt_ins, "%u,", res->value.ui32);
break;
case ULOGD_RET_UINT64:
- sprintf(stmt_ins, "%lu,", res->value.ui64);
+ sprintf(stmt_ins, "%llu,", res->value.ui64);
break;
case ULOGD_RET_BOOL:
sprintf(stmt_ins, "'%d',", res->value.b);
@@ -243,7 +229,7 @@ static int _mysql_createstmt(void)
for (f = fields; f; f = f->next) {
strncpy(buf, f->name, ULOGD_MAX_KEYLEN);
- while (underscore = strchr(buf, '.'))
+ while ((underscore = strchr(buf, '.')))
*underscore = '_';
sprintf(stmt_val, "%s,", buf);
stmt_val = stmt + strlen(stmt);
@@ -275,11 +261,11 @@ static int _mysql_get_columns(const char *table)
if (!result)
return 1;
- while (field = mysql_fetch_field(result)) {
+ while ((field = mysql_fetch_field(result))) {
/* replace all underscores with dots */
strncpy(buf, field->name, ULOGD_MAX_KEYLEN);
- while (underscore = strchr(buf, '_'))
+ while ((underscore = strchr(buf, '_')))
*underscore = '.';
DEBUGP("field '%s' found: ", buf);