From 0ff5ab90a4e0eaef4cf60b5bdad47d92ef285617 Mon Sep 17 00:00:00 2001 From: SJ Date: Thu, 10 Jul 2014 10:20:17 +0200 Subject: [PATCH] errno fix --- src/defs.h | 2 +- src/misc.c | 2 +- src/mysql.c | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/defs.h b/src/defs.h index aa8dd348..4adfeb88 100644 --- a/src/defs.h +++ b/src/defs.h @@ -213,7 +213,7 @@ struct session_data { int journal_envelope_length, journal_bottom_length; #ifdef NEED_MYSQL MYSQL mysql; - unsigned int errno; + unsigned int mysql_errno; #endif #ifdef NEED_PSQL PGconn *psql; diff --git a/src/misc.c b/src/misc.c index 426e1526..6dbfad7a 100644 --- a/src/misc.c +++ b/src/misc.c @@ -511,7 +511,7 @@ void init_session_data(struct session_data *sdata, struct __config *cfg){ sdata->sent = sdata->delivered = sdata->retained = sdata->now; #ifdef NEED_MYSQL - sdata->errno = 0; + sdata->mysql_errno = 0; #endif #ifdef HAVE_TWEAK_SENT_TIME diff --git a/src/mysql.c b/src/mysql.c index d1aa0d79..21aae40f 100644 --- a/src/mysql.c +++ b/src/mysql.c @@ -57,7 +57,7 @@ int p_exec_query(struct session_data *sdata, MYSQL_STMT *stmt, struct __data *da unsigned long length[MAX_SQL_VARS]; int i, ret=ERR; - sdata->errno = 0; + sdata->mysql_errno = 0; memset(bind, 0, sizeof(bind)); for(i=0; ierrno = mysql_stmt_errno(stmt); - syslog(LOG_PRIORITY, "%s: mysql_stmt_bind_param() error: %s (errno: %d)", sdata->ttmpfile, mysql_stmt_error(stmt), sdata->errno); + sdata->mysql_errno = mysql_stmt_errno(stmt); + syslog(LOG_PRIORITY, "%s: mysql_stmt_bind_param() error: %s (errno: %d)", sdata->ttmpfile, mysql_stmt_error(stmt), sdata->mysql_errno); goto CLOSE; } if(mysql_stmt_execute(stmt)){ - sdata->errno = mysql_stmt_errno(stmt); - syslog(LOG_PRIORITY, "%s: mysql_stmt_execute error: *%s* (errno: %d)", sdata->ttmpfile, mysql_error(&(sdata->mysql)), sdata->errno); + sdata->mysql_errno = mysql_stmt_errno(stmt); + syslog(LOG_PRIORITY, "%s: mysql_stmt_execute error: *%s* (errno: %d)", sdata->ttmpfile, mysql_error(&(sdata->mysql)), sdata->mysql_errno); goto CLOSE; }