]> git.sur5r.net Git - bacula/bacula/commitdiff
Separate batch init error messages.
authorKern Sibbald <kern@sibbald.com>
Wed, 26 Sep 2007 10:36:49 +0000 (10:36 +0000)
committerKern Sibbald <kern@sibbald.com>
Wed, 26 Sep 2007 10:36:49 +0000 (10:36 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@5649 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/cats/sql_create.c
bacula/technotes-2.3

index e2811e827b64e3e2e0b8f8c3d211576b99d335fb..80bc5238229bc5a964c51e8ea48dbc778a59ceb3 100644 (file)
@@ -846,19 +846,21 @@ bool db_create_file_attributes_record(JCR *jcr, B_DB *mdb, ATTR_DBR *ar)
                                       mdb->db_port,
                                       mdb->db_socket,
                                       1 /* multi_db = true */);
+      if (!jcr->db_batch) {
+         Jmsg1(jcr, M_FATAL, 0, _("Could not init batch database: \"%s\".\n"),
+               jcr->db->db_name);
+         return false;
+      }
 
-      if (!jcr->db_batch || !db_open_database(jcr, jcr->db_batch)) {
-         Jmsg(jcr, M_FATAL, 0, _("Could not open database \"%s\".\n"),
-              jcr->db->db_name);
-         if (jcr->db_batch) {
-            Jmsg(jcr, M_FATAL, 0, "%s", db_strerror(jcr->db_batch));
-         }
+      if (!db_open_database(jcr, jcr->db_batch)) {
+         Jmsg(jcr, M_FATAL, 0, _("Could not open database \"%s\": ERR=%s.\n"),
+              jcr->db->db_name, db_strerror(jcr->db_batch));
          return false;
       }      
       
       if (!sql_batch_start(jcr, jcr->db_batch)) {
          Jmsg(jcr, M_FATAL, 0, 
-              "Can't start batch mode %s", db_strerror(jcr->db_batch));
+              "Can't start batch mode: ERR=%s", db_strerror(jcr->db_batch));
          return false;
       }
       Dmsg3(100, "initdb ref=%d connected=%d db=%p\n", jcr->db_batch->ref_count,
index a84090c41e8e334bc02f62f1acc361be95653768..58d953637509985626e63416f14b6b9f14b613b4 100644 (file)
@@ -2,6 +2,7 @@
 
 General:
 26Sep07
+kes  Separate batch init error messages.
 kes  Make SD code that contructs attribute insert check string lengths
      more carefully.
 kes  If Dir gets an error during inserting attributes, cancel SD.