From af38182b0d84cad2768c1567a2f04c47a0d76cf7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Franti=C5=A1ek=20Dvo=C5=99=C3=A1k?= Date: Thu, 29 Oct 2009 16:13:14 +0000 Subject: [PATCH] Various crash/build fixes. --- org.glite.lbjp-common.db/Makefile | 8 +++----- org.glite.lbjp-common.db/examples/db_test.c | 2 +- org.glite.lbjp-common.db/src/db.c | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/org.glite.lbjp-common.db/Makefile b/org.glite.lbjp-common.db/Makefile index 6e96135..738e8dc 100644 --- a/org.glite.lbjp-common.db/Makefile +++ b/org.glite.lbjp-common.db/Makefile @@ -88,12 +88,10 @@ check_soname: fi \ fi -db.lo: check_soname - -libglite_lbu_db.la: ${LOBJS} +libglite_lbu_db.la: check_soname ${LOBJS} ${LINK} -o $@ $+ ${EXT_LIBS} -libglite_lbu_dbtest.la: ${LTESTOBJS} +libglite_lbu_dbtest.la: check_soname ${LTESTOBJS} ${LINK} -o $@ $+ ${EXT_LIBS} dbtest.lo dbtest.o: db.c db.h @@ -168,4 +166,4 @@ db_test.lo: libglite_lbu_dbtest.la db.h db-int.h db_test.c db-mysql.lo: db-mysql.c db-int.h db.h db-pg.lo: db-pg.c db-int.h db.h -.PHONY: default all compile check examples doc stage dist distsrc distbin install clean test_coverage +.PHONY: default all compile check examples doc stage dist distsrc distbin install clean test_coverage check_soname diff --git a/org.glite.lbjp-common.db/examples/db_test.c b/org.glite.lbjp-common.db/examples/db_test.c index f87aff7..2ae6738 100644 --- a/org.glite.lbjp-common.db/examples/db_test.c +++ b/org.glite.lbjp-common.db/examples/db_test.c @@ -92,7 +92,7 @@ int main(int argn __attribute((unused)), char *argv[]) { // init dprintf(("connecting to %s...\n", cs)); - if (glite_lbu_InitDBContext(&ctx) != 0) goto failctx; + if (glite_lbu_InitDBContext(&ctx, GLITE_LBU_DB_BACKEND_MYSQL) != 0) goto failctx; if (glite_lbu_DBConnect(ctx, cs) != 0) goto failctx; if ((caps = glite_lbu_DBQueryCaps(ctx)) == -1) goto failcon; #ifndef NO_PREPARED diff --git a/org.glite.lbjp-common.db/src/db.c b/org.glite.lbjp-common.db/src/db.c index c799165..59cab6c 100644 --- a/org.glite.lbjp-common.db/src/db.c +++ b/org.glite.lbjp-common.db/src/db.c @@ -222,7 +222,7 @@ int glite_lbu_FetchRow(glite_lbu_Statement stmt, unsigned int n, unsigned long * void glite_lbu_FreeStmt(glite_lbu_Statement *stmt) { - if (!VALID((*stmt)->ctx->backend)) return; + if (!stmt || !VALID((*stmt)->ctx->backend)) return; return backends[(*stmt)->ctx->backend]->freeStmt(stmt); } -- 1.8.2.3