summaryrefslogtreecommitdiff
path: root/plugins/ompgsql
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2008-12-12 17:46:20 +0100
committerMichael Biebl <biebl@debian.org>2008-12-12 17:46:20 +0100
commit84080b58f8c6c5c040723a02503ddd90f02b5898 (patch)
treecf8c63e076f1ebb9cb2bea644a4f45172808a3e5 /plugins/ompgsql
parent53123ea8a1b9180b9aa0568e847f9245987c1b7c (diff)
downloadrsyslog-84080b58f8c6c5c040723a02503ddd90f02b5898.tar.gz
Imported Upstream version 3.20.2upstream/3.20.2
Diffstat (limited to 'plugins/ompgsql')
-rw-r--r--plugins/ompgsql/Makefile.am2
-rw-r--r--plugins/ompgsql/Makefile.in13
-rw-r--r--plugins/ompgsql/ompgsql.c12
3 files changed, 17 insertions, 10 deletions
diff --git a/plugins/ompgsql/Makefile.am b/plugins/ompgsql/Makefile.am
index b2e3eff..cc1c5f4 100644
--- a/plugins/ompgsql/Makefile.am
+++ b/plugins/ompgsql/Makefile.am
@@ -1,7 +1,7 @@
pkglib_LTLIBRARIES = ompgsql.la
ompgsql_la_SOURCES = ompgsql.c ompgsql.h
-ompgsql_la_CPPFLAGS = -I$(top_srcdir) $(pgsql_cflags)
+ompgsql_la_CPPFLAGS = -I$(top_srcdir) $(pgsql_cflags) $(rsrt_cflags)
ompgsql_la_LDFLAGS = -module -avoid-version
ompgsql_la_LIBADD = $(pgsql_libs)
diff --git a/plugins/ompgsql/Makefile.in b/plugins/ompgsql/Makefile.in
index ff3c2a7..dff4578 100644
--- a/plugins/ompgsql/Makefile.in
+++ b/plugins/ompgsql/Makefile.in
@@ -103,6 +103,7 @@ EXEEXT = @EXEEXT@
F77 = @F77@
FFLAGS = @FFLAGS@
GREP = @GREP@
+HAVE_GNUTLS_CONFIG = @HAVE_GNUTLS_CONFIG@
HAVE_MYSQL_CONFIG = @HAVE_MYSQL_CONFIG@
HAVE_PGSQL_CONFIG = @HAVE_PGSQL_CONFIG@
INSTALL = @INSTALL@
@@ -111,6 +112,8 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
+LIBLOGGING_CFLAGS = @LIBLOGGING_CFLAGS@
+LIBLOGGING_LIBS = @LIBLOGGING_LIBS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
@@ -131,6 +134,8 @@ PKG_CONFIG = @PKG_CONFIG@
RANLIB = @RANLIB@
RELP_CFLAGS = @RELP_CFLAGS@
RELP_LIBS = @RELP_LIBS@
+RFC3195_CFLAGS = @RFC3195_CFLAGS@
+RFC3195_LIBS = @RFC3195_LIBS@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
@@ -161,6 +166,8 @@ dl_libs = @dl_libs@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
+gnutls_cflags = @gnutls_cflags@
+gnutls_libs = @gnutls_libs@
gss_libs = @gss_libs@
host = @host@
host_alias = @host_alias@
@@ -190,8 +197,8 @@ program_transform_name = @program_transform_name@
psdir = @psdir@
pthreads_cflags = @pthreads_cflags@
pthreads_libs = @pthreads_libs@
-rfc3195_cflags = @rfc3195_cflags@
-rfc3195_libs = @rfc3195_libs@
+rsrt_cflags = @rsrt_cflags@
+rsrt_libs = @rsrt_libs@
rt_libs = @rt_libs@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
@@ -206,7 +213,7 @@ top_srcdir = @top_srcdir@
zlib_libs = @zlib_libs@
pkglib_LTLIBRARIES = ompgsql.la
ompgsql_la_SOURCES = ompgsql.c ompgsql.h
-ompgsql_la_CPPFLAGS = -I$(top_srcdir) $(pgsql_cflags)
+ompgsql_la_CPPFLAGS = -I$(top_srcdir) $(pgsql_cflags) $(rsrt_cflags)
ompgsql_la_LDFLAGS = -module -avoid-version
ompgsql_la_LIBADD = $(pgsql_libs)
EXTRA_DIST = createDB.sql
diff --git a/plugins/ompgsql/ompgsql.c b/plugins/ompgsql/ompgsql.c
index 1d7b2eb..7658f03 100644
--- a/plugins/ompgsql/ompgsql.c
+++ b/plugins/ompgsql/ompgsql.c
@@ -36,7 +36,7 @@
#include <errno.h>
#include <time.h>
#include <libpq-fe.h>
-#include "syslogd.h"
+#include "dirty.h"
#include "syslogd-types.h"
#include "srUtils.h"
#include "template.h"
@@ -113,7 +113,7 @@ static void reportDBError(instanceData *pData, int bSilent)
/* output log message */
errno = 0;
if(pData->f_hpgsql == NULL) {
- errmsg.LogError(NO_ERRCODE, "unknown DB error occured - could not obtain PgSQL handle");
+ errmsg.LogError(0, NO_ERRCODE, "unknown DB error occured - could not obtain PgSQL handle");
} else { /* we can ask pgsql for the error description... */
ePgSQLStatus = PQstatus(pData->f_hpgsql);
snprintf(errMsg, sizeof(errMsg)/sizeof(char), "db error (%d): %s\n", ePgSQLStatus,
@@ -122,7 +122,7 @@ static void reportDBError(instanceData *pData, int bSilent)
dbgprintf("pgsql, DBError(silent): %s\n", errMsg);
else {
pData->eLastPgSQLStatus = ePgSQLStatus;
- errmsg.LogError(NO_ERRCODE, "%s", errMsg);
+ errmsg.LogError(0, NO_ERRCODE, "%s", errMsg);
}
}
@@ -167,12 +167,12 @@ rsRetVal writePgSQL(uchar *psz, instanceData *pData)
dbgprintf("writePgSQL: %s", psz);
/* try insert */
- PQexec(pData->f_hpgsql, (char*)psz);
+ PQclear(PQexec(pData->f_hpgsql, (char*)psz));
if(PQstatus(pData->f_hpgsql) != CONNECTION_OK) {
/* error occured, try to re-init connection and retry */
closePgSQL(pData); /* close the current handle */
CHKiRet(initPgSQL(pData, 0)); /* try to re-open */
- PQexec(pData->f_hpgsql, (char*)psz);
+ PQclear(PQexec(pData->f_hpgsql, (char*)psz));
if(PQstatus(pData->f_hpgsql) != CONNECTION_OK) { /* re-try insert */
/* we failed, giving up for now */
reportDBError(pData, 0);
@@ -264,7 +264,7 @@ CODE_STD_STRING_REQUESTparseSelectorAct(1)
* Retries make no sense.
*/
if (iPgSQLPropErr) {
- errmsg.LogError(NO_ERRCODE, "Trouble with PgSQL connection properties. -PgSQL logging disabled");
+ errmsg.LogError(0, RS_RET_INVALID_PARAMS, "Trouble with PgSQL connection properties. -PgSQL logging disabled");
ABORT_FINALIZE(RS_RET_INVALID_PARAMS);
} else {
CHKiRet(initPgSQL(pData, 0));