]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/stored/append.c
Get correct slot when auto unloading a device.
[bacula/bacula] / bacula / src / stored / append.c
index 6519c7012366f10c05c41af6f3bc347895625b72..382dd2d556a8b0a1e46ca7ca33e11b9c501b330a 100644 (file)
@@ -1,7 +1,7 @@
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2000-2007 Free Software Foundation Europe e.V.
+   Copyright (C) 2000-2008 Free Software Foundation Europe e.V.
 
    The main author of Bacula is Kern Sibbald, with contributions from
    many others, a complete list can be found in the file AUTHORS.
@@ -70,7 +70,7 @@ bool do_append_data(JCR *jcr)
       return false;
    }                                              
 
-   Dmsg1(100, "Start append data. res=%d\n", dev->reserved_device);
+   Dmsg1(100, "Start append data. res=%d\n", dev->num_reserved());
 
    memset(&rec, 0, sizeof(rec));
 
@@ -287,7 +287,7 @@ bool do_append_data(JCR *jcr)
     * Check if we can still write. This may not be the case
     *  if we are at the end of the tape or we got a fatal I/O error.
     */
-   if (dev->can_write()) {
+   if (ok || dev->can_write()) {
       if (!write_session_label(dcr, EOS_LABEL)) {
          Jmsg1(jcr, M_FATAL, 0, _("Error writting end session label. ERR=%s\n"),
                dev->bstrerror());
@@ -296,6 +296,7 @@ bool do_append_data(JCR *jcr)
       }
       if (dev->VolCatInfo.VolCatName[0] == 0) {
          Pmsg0(000, _("NULL Volume name. This shouldn't happen!!!\n"));
+         Dmsg0(000, _("NULL Volume name. This shouldn't happen!!!\n"));
       }
       Dmsg0(90, "back from write_end_session_label()\n");
       /* Flush out final partial block of this session */
@@ -307,6 +308,7 @@ bool do_append_data(JCR *jcr)
       }
       if (dev->VolCatInfo.VolCatName[0] == 0) {
          Pmsg0(000, _("NULL Volume name. This shouldn't happen!!!\n"));
+         Dmsg0(000, _("NULL Volume name. This shouldn't happen!!!\n"));
       }
    }