summaryrefslogtreecommitdiffabout
path: root/src/pgsql.c
Side-by-side diff
Diffstat (limited to 'src/pgsql.c') (more/less context) (ignore whitespace changes)
-rw-r--r--src/pgsql.c27
1 files changed, 10 insertions, 17 deletions
diff --git a/src/pgsql.c b/src/pgsql.c
index c5cf51e..1421c40 100644
--- a/src/pgsql.c
+++ b/src/pgsql.c
@@ -21,24 +21,17 @@
#include <guile-sql.h>
#include <libpq-fe.h>
-static SCM
-s_pgsql_mark(struct sql_connect *conn)
-{
- return SCM_BOOL_F;
-}
-
-static scm_sizet
+static size_t
s_pgsql_free(struct sql_connect *conn)
{
PGconn *pgconn = (PGconn*) conn->data;
- if (!pgconn)
- return 0;
- PQfinish(pgconn);
- return sizeof(pgconn);
+ if (pgconn)
+ PQfinish(pgconn);
+ return 0;
}
static SCM
-s_pgsql_connect (SCM parmlist, const char *func_name)
+s_pgsql_connect(SCM parmlist, const char *func_name)
{
char *hostname = NULL;
char *port = NULL;
@@ -168,15 +161,15 @@ static void
s_pgsql_close(struct sql_connect *conn)
{
PGconn *pgconn = (PGconn*) conn->data;
- if (!pgconn)
- return;
- PQfinish(pgconn);
- conn->data = NULL;
+ if (pgconn) {
+ PQfinish(pgconn);
+ conn->data = NULL;
+ }
}
struct sql_iface pgsql_iface = {
"pgsql",
- s_pgsql_mark,
+ NULL, /* mark */
s_pgsql_free,
s_pgsql_connect,
s_pgsql_close,

Return to:

Send suggestions and report system problems to the System administrator.