]> git.sur5r.net Git - bacula/bacula/commitdiff
- Remove \a and -e from error echos in most Makefiles.
authorKern Sibbald <kern@sibbald.com>
Sat, 26 Mar 2005 16:55:46 +0000 (16:55 +0000)
committerKern Sibbald <kern@sibbald.com>
Sat, 26 Mar 2005 16:55:46 +0000 (16:55 +0000)
- Add more debug code when there are errors on the tape
  to try to find Peter's tape problem.

git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1901 91ce42f0-d328-0410-95d8-f526ca767f89

12 files changed:
bacula/Makefile.in
bacula/src/cats/Makefile.in
bacula/src/console/Makefile.in
bacula/src/dird/Makefile.in
bacula/src/filed/Makefile.in
bacula/src/findlib/Makefile.in
bacula/src/stored/Makefile.in
bacula/src/stored/acquire.c
bacula/src/stored/append.c
bacula/src/stored/autochanger.c
bacula/src/stored/spool.c
bacula/src/tools/Makefile.in

index 02fbdadc4e9c2a9cd50c631c9bf181d6dc715dee..c44fe2c86f9577d8309b06c37c6f2923514cbde0 100755 (executable)
@@ -38,7 +38,7 @@ MKDIR = $(srcdir)/autoconf/mkinstalldirs
 all: Makefile
        @for I in ${all_subdirs}; \
          do (cd $$I; echo "==>Entering directory `pwd`"; \
-             $(MAKE) $@ || (echo ""; echo ""; echo -e "  \a\a ====== Error in `pwd` ======\a\a"; \
+             $(MAKE) $@ || (echo ""; echo ""; echo "  ====== Error in `pwd` ======"; \
                            echo ""; echo "";)); \
        done
 
@@ -49,7 +49,7 @@ depend:
 bacula-fd: Makefile       
        @for I in ${fd_subdirs}; \
          do (cd $$I; echo "==>Entering directory `pwd`"; \
-             $(MAKE) all || (echo ""; echo ""; echo -e "  \a\a ====== Error in `pwd` ======\a\a"; \
+             $(MAKE) all || (echo ""; echo ""; echo "   ====== Error in `pwd` ======; \
                            echo ""; echo "";)); \
        done
 
index b33dc09f5254a72b9f7b9624d856c229a4cb84f8..e67461dee0acdfe25c2a7c0e1d2d5d44e96bd4b5 100644 (file)
@@ -157,7 +157,7 @@ depend:
            $(RMF) Makefile.bak; \
        else \
           $(MV) Makefile.bak Makefile; \
-          echo -e "Something went wrong\n\a"; \
+          echo " ===== Something went wrong in make depend ====="; \
        fi
 
 # -----------------------------------------------------------------------
index 838e0a8b83d5c823d7b4046ea313490e2b228d49..25f05988694fbb1576eb46f0f6f6bc310926aa67 100644 (file)
@@ -119,7 +119,7 @@ depend:
            $(RMF) Makefile.bak; \
        else \
           $(MV) Makefile.bak Makefile; \
-          echo -e "Something went wrong\n\a"; \
+          echo " ===== Something went wrong in make depend ====="; \
        fi
 
 # -----------------------------------------------------------------------
index b5c6d9f1b21f01b958364205a49eaed8e5958a91..90b74b31c8da8d5bff30ab079099c4f4c30e329a 100644 (file)
@@ -142,7 +142,7 @@ depend:
            $(RMF) Makefile.bak; \
        else \
           $(MV) Makefile.bak Makefile; \
-          echo -e "Something went wrong\n\a"; \
+          echo " ===== Something went wrong in make depend ====="; \
        fi
 
 # -----------------------------------------------------------------------
index 2ff0648de251e893b5e99e13494733a0b972b232..3c0f04d206cb964afbe592a641b0b0ce85523a67 100755 (executable)
@@ -146,7 +146,7 @@ depend:
            $(RMF) Makefile.bak; \
        else \
           $(MV) Makefile.bak Makefile; \
-          echo -e "Something went wrong\n\a"; \
+          echo " ===== Something went wrong in make depend ====="; \
        fi
 
 # -----------------------------------------------------------------------
index 2bbdacc573ad6b9cf3ba4177be6642844bf0329b..00bad4adf7f04b1ec563c1882d4f87f42d944dce 100644 (file)
@@ -86,7 +86,7 @@ depend:
            $(RMF) Makefile.bak; \
        else \
           $(MV) Makefile.bak Makefile; \
-          echo -e "Something went wrong\n\a"; \
+          echo " ===== Something went wrong in make depend ====="; \
        fi
 
 # -----------------------------------------------------------------------
index 2862e8a4e1d7eb7c9af09bc80430295362733341..f791977444aa70ab91345f7b18a775b8b9693827 100644 (file)
@@ -195,7 +195,7 @@ depend:
            $(RMF) Makefile.bak; \
        else \
           $(MV) Makefile.bak Makefile; \
-          echo -e "Something went wrong with make depend\n\a"; \
+          echo " ======= Something went wrong with make depend. ======="; \
        fi
 
 # -----------------------------------------------------------------------
index 64053c7e566f3a83d862f1cb2e3baead5fab55e4..303fe650a83184e97770209ad38830463b5e3371 100644 (file)
@@ -248,6 +248,8 @@ DCR *acquire_device_for_read(DCR *dcr)
          Dmsg1(120, "bstored: open vol=%s\n", dcr->VolumeName);
         if (open_dev(dev, dcr->VolumeName, OPEN_READ_ONLY) < 0) {
            if (dev->dev_errno == EIO) {   /* no tape loaded */
+              Jmsg3(jcr, M_WARNING, 0, _("Open device %s Volume \"%s\" failed: ERR=%s\n"),
+                   dev->print_name(), dcr->VolumeName, strerror_dev(dev));
               goto default_path;
            }
            
@@ -258,7 +260,7 @@ DCR *acquire_device_for_read(DCR *dcr)
               break;
            }
            
-            Jmsg(jcr, M_FATAL, 0, _("Open device %s Volume \"%s\" failed: ERR=%s\n"),
+            Jmsg3(jcr, M_FATAL, 0, _("Open device %s Volume \"%s\" failed: ERR=%s\n"),
                dev->print_name(), dcr->VolumeName, strerror_dev(dev));
            goto get_out;
         }
@@ -294,7 +296,7 @@ DCR *acquire_device_for_read(DCR *dcr)
         }
         /* Fall through */
       default:
-         Jmsg(jcr, M_WARNING, 0, "%s", jcr->errmsg);
+         Jmsg1(jcr, M_WARNING, 0, "%s", jcr->errmsg);
 default_path:
         tape_previously_mounted = true;
         
@@ -608,11 +610,7 @@ bool release_device(DCR *dcr)
 
    if (dev->can_read()) {
       dev->clear_read();             /* clear read bit */
-      /* Close if file or !CAP_ALWAYSOPEN */
-      if (!dev->is_tape() || !dev_cap(dev, CAP_ALWAYSOPEN)) {
-        offline_or_rewind_dev(dev);
-        close_dev(dev);
-      }
+
       /******FIXME**** send read volume usage statistics to director */
 
    } else if (dev->num_writers > 0) {
@@ -638,16 +636,18 @@ bool release_device(DCR *dcr)
          Dmsg0(100, "==== write ansi eof label \n");
       }
 
-      /* If no writers, close if file or !CAP_ALWAYS_OPEN */
-      if (dev->num_writers == 0 && (!dev->is_tape() || !dev_cap(dev, CAP_ALWAYSOPEN))) {
-        offline_or_rewind_dev(dev);
-        close_dev(dev);
-      }
    } else {
-      Jmsg2(jcr, M_FATAL, 0, _("BAD ERROR: release_device %s, Volume \"%s\" not in use.\n"),
-           dev->print_name(), NPRT(dcr->VolumeName));
-      Jmsg2(jcr, M_ERROR, 0, _("num_writers=%d state=%x\n"), dev->num_writers, dev->state);
-      ok = false;
+      /*               
+       * If we reach here, it is most likely because the
+       *   has failed, since the device is not in read mode and
+       *   there are no writers.
+       */
+   }
+
+   /* If no writers, close if file or !CAP_ALWAYS_OPEN */
+   if (dev->num_writers == 0 && (!dev->is_tape() || !dev_cap(dev, CAP_ALWAYSOPEN))) {
+      offline_or_rewind_dev(dev);
+      close_dev(dev);
    }
 
    /* Fire off Alert command and include any output */
index 40db5cd2bbc993c687292650aacad6f0fb04dc62..8904fad7710a19b3f4293ceaa7f00974a5804880 100644 (file)
@@ -266,8 +266,9 @@ bool do_append_data(JCR *jcr)
       Dmsg0(90, "back from write_end_session_label()\n");
       /* Flush out final partial block of this session */
       if (!write_block_to_device(dcr)) {
+         Jmsg2(jcr, M_FATAL, 0, _("Fatal append error on device %s: ERR=%s\n"),
+              dev->print_name(), strerror_dev(dev));
          Dmsg0(100, _("Set ok=FALSE after write_block_to_device.\n"));
-        set_jcr_job_status(jcr, JS_ErrorTerminated);
         ok = false;
       }
    }
index a1f36eeaf6de0693586a9c38b0e974f2c0f2c31c..43755e4e6d7794c73e669ce74955f65037f4ba49 100644 (file)
@@ -261,7 +261,7 @@ bool autochanger_cmd(DCR *dcr, BSOCK *dir, const char *cmd)
       loaded = get_autochanger_loaded_slot(dcr);
       if (loaded > 0) {
         bnet_fsend(dir,
-            _("3305 Issuing autochanger \"unload slot %d, drive %d\" command.\n"),
+            _("3307 Issuing autochanger \"unload slot %d, drive %d\" command.\n"),
            loaded, drive);
         slot = dcr->VolCatInfo.Slot;
         dcr->VolCatInfo.Slot = loaded;
index e3e4cf3fa7677d7985acdb9e21279c50a25810d7..f38839a4bd12f32cccca64dbd2247553ad8717ef 100644 (file)
@@ -243,6 +243,10 @@ static bool despool_data(DCR *dcr, bool commit)
         break;
       }
       ok = write_block_to_device(dcr);
+      if (!ok) {
+         Jmsg2(jcr, M_FATAL, 0, _("Fatal append error on device %s: ERR=%s\n"),
+              dcr->dev->print_name(), strerror_dev(dcr->dev));
+      }
       Dmsg3(800, "Write block ok=%d FI=%d LI=%d\n", ok, block->FirstIndex, block->LastIndex);
    }
    dcr->block = block;               /* reset block */
index f19a0d41cdc62be3be0e30704f432872a227ee4e..0c912213d6d48a676ecf47e033bf0bef8bc3cb01 100644 (file)
@@ -104,7 +104,7 @@ depend:
            $(RMF) Makefile.bak; \
        else \
           $(MV) Makefile.bak Makefile; \
-          echo -e "Something went wrong\n\a"; \
+          echo " ===== Something went wrong in make depend ====="; \
        fi
 
 # -----------------------------------------------------------------------