Various crash/build fixes.
authorFrantišek Dvořák <valtri@civ.zcu.cz>
Thu, 29 Oct 2009 16:13:14 +0000 (16:13 +0000)
committerFrantišek Dvořák <valtri@civ.zcu.cz>
Thu, 29 Oct 2009 16:13:14 +0000 (16:13 +0000)
org.glite.lbjp-common.db/Makefile
org.glite.lbjp-common.db/examples/db_test.c
org.glite.lbjp-common.db/src/db.c

index 6e96135..738e8dc 100644 (file)
@@ -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
index f87aff7..2ae6738 100644 (file)
@@ -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
index c799165..59cab6c 100644 (file)
@@ -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);
 }