From 062a1f261ea6069c10d098e463f54c198e60ec80 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ale=C5=A1=20K=C5=99enek?= Date: Thu, 22 Nov 2007 13:01:26 +0000 Subject: [PATCH] propagate connection error --- org.glite.lbjp-common.db/src/db.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/org.glite.lbjp-common.db/src/db.c b/org.glite.lbjp-common.db/src/db.c index 6b29fc9..1c8e663 100644 --- a/org.glite.lbjp-common.db/src/db.c +++ b/org.glite.lbjp-common.db/src/db.c @@ -938,10 +938,14 @@ static int db_connect(glite_lbu_DBContext ctx, const char *cs, MYSQL **mysql) { * working in update_notif(). * Hope it does not break anything else */ if (!db_handle.mysql_real_connect(*mysql,host,user,pw,db,0,NULL,CLIENT_FOUND_ROWS)) { + char *desc; free(buf); ret = MY_ERR(ctx); + desc = ctx->err.desc; + ctx->err.desc = NULL; glite_lbu_DBClose(ctx); - return ret; + ctx->err.desc = desc; + return ctx->err.code = ret; } free(buf); -- 1.8.2.3