From 631e5f0181fbbc5d530edd6f66dc03103d674bf4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Franti=C5=A1ek=20Dvo=C5=99=C3=A1k?= Date: Fri, 6 Jun 2008 14:04:31 +0000 Subject: [PATCH] Revert the context "fix" - on error is good to know the error from the context. --- org.glite.lbjp-common.db/src/db.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/org.glite.lbjp-common.db/src/db.c b/org.glite.lbjp-common.db/src/db.c index 9827820..5738141 100644 --- a/org.glite.lbjp-common.db/src/db.c +++ b/org.glite.lbjp-common.db/src/db.c @@ -192,11 +192,8 @@ int glite_lbu_InitDBContext(glite_lbu_DBContext *ctx) { pthread_mutex_lock(&db_handle.lock); if (!db_handle.lib) { if ((!MYSQL_LIBPATH[0] || (db_handle.lib = dlopen(MYSQL_LIBPATH, RTLD_LAZY | RTLD_LOCAL)) == NULL) && - (db_handle.lib = dlopen("libmysqlclient.so", RTLD_LAZY | RTLD_LOCAL)) == NULL) { - free(*ctx); - *ctx = NULL; + (db_handle.lib = dlopen("libmysqlclient.so", RTLD_LAZY | RTLD_LOCAL)) == NULL) return ERR(*ctx, ENOENT, "can't load '%s' or 'libmysqlclient.so' (%s)", MYSQL_LIBPATH, dlerror()); - } do { LOAD(mysql_init, "mysql_init"); LOAD(mysql_get_client_version, "mysql_get_client_version"); @@ -244,8 +241,6 @@ int glite_lbu_InitDBContext(glite_lbu_DBContext *ctx) { dlclose(db_handle.lib); db_handle.lib = NULL; pthread_mutex_unlock(&db_handle.lock); - free(*ctx); - *ctx = NULL; return err; } } else pthread_mutex_unlock(&db_handle.lock); -- 1.8.2.3