From: Kern Sibbald Date: Sun, 21 Sep 2003 18:16:27 +0000 (+0000) Subject: Fix double close of db during status X-Git-Tag: Release-1.32~9 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=853e2567fb4099c7ee1809e511cfb4c70ecf2e14;p=bacula%2Fbacula Fix double close of db during status git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@710 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/kernstodo b/bacula/kernstodo index efc64b41ca..00228063c9 100644 --- a/bacula/kernstodo +++ b/bacula/kernstodo @@ -38,6 +38,7 @@ For 1.32: For 1.33 +- Upgrade to cygwin 1.5 - Get MySQL 3.23.58 - Get and test MySQL 4.0 - Do a complete audit of all pthreads_mutex, cond, ... to ensure that diff --git a/bacula/src/dird/ua_status.c b/bacula/src/dird/ua_status.c index a8196d8736..65bd47c26d 100644 --- a/bacula/src/dird/ua_status.c +++ b/bacula/src/dird/ua_status.c @@ -397,12 +397,16 @@ static void prt_runtime(UAContext *ua, JOB *job, int level, time_t runtime, POOL { char dt[MAX_TIME_LENGTH]; bool ok = false; + bool close_db = false; JCR *jcr = ua->jcr; MEDIA_DBR mr; memset(&mr, 0, sizeof(mr)); if (job->JobType == JT_BACKUP) { jcr->db = NULL; ok = complete_jcr_for_job(jcr, job, pool); + if (jcr->db) { + close_db = true; /* new db opened, remember to close it */ + } if (ok) { ok = find_next_volume_for_append(jcr, &mr, 0); } @@ -414,10 +418,10 @@ static void prt_runtime(UAContext *ua, JOB *job, int level, time_t runtime, POOL bsendmsg(ua, _("%-14s %-8s %-18s %-18s %s\n"), level_to_str(level), job_type_to_str(job->JobType), dt, job->hdr.name, mr.VolumeName); - if (jcr->db) { + if (close_db) { db_close_database(jcr, jcr->db); - jcr->db = ua->db; } + jcr->db = ua->db; /* restore ua db to jcr */ }