]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/stored/acquire.c
Make btape fill/unfill work
[bacula/bacula] / bacula / src / stored / acquire.c
index d26a293423391b4dbf8f8746888d0dc93981dcc7..7e92fed82638adffaef5c6dd04064afae3f764e1 100644 (file)
@@ -100,11 +100,11 @@ int acquire_device_for_read(JCR *jcr, DEVICE *dev, DEV_BLOCK *block)
          *  error messages when nothing is mounted.
          */
         if (tape_previously_mounted) {
-            Jmsg1(jcr, M_WARNING, 0, "%s", jcr->errmsg);                         
+            Jmsg(jcr, M_WARNING, 0, "%s", jcr->errmsg);                         
         }
         goto default_path;
       default:
-         Jmsg1(jcr, M_WARNING, 0, "%s", jcr->errmsg);
+         Jmsg(jcr, M_WARNING, 0, "%s", jcr->errmsg);
 default_path:
         tape_previously_mounted = 1;
         if (autochanger) {
@@ -289,7 +289,9 @@ int release_device(JCR *jcr, DEVICE *dev)
       if (dev->num_writers == 0) {
          Dmsg0(100, "dir_create_jobmedia_record. Release\n");
         dir_create_jobmedia_record(jcr);
-        weof_dev(dev, 1);
+        if (dev_can_write(dev)) {
+           weof_dev(dev, 1);
+        }
         dev->VolCatInfo.VolCatFiles = dev->file;   /* set number of files */
         dev->VolCatInfo.VolCatJobs++;              /* increment number of jobs */
         /* Note! do volume update before close, which zaps VolCatInfo */