+Changes to 1.37.25 release on 20 Jun 05:
+20Jun05:
+- Fix bug where Storage daemon gets confused about what
+  tape is mounted. (one line of code was inadvertently 
+  deleted).
+
 Changes to 1.37.24:
 18Jun05
 - DVD writing/reading seems to be mostly working.
 
 
 General:
 
+Changes to 1.37.25 release on 20 Jun 05:
+20Jun05:
+- Fix bug where Storage daemon gets confused about what
+  tape is mounted. (one line of code was inadvertently 
+  deleted).
+
 Changes to 1.37.24:
 18Jun05
 - DVD writing/reading seems to be mostly working.
 
  *
  *    Version $Id$
  */
-
 /*
    Copyright (C) 2003-2005 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License as
-   published by the Free Software Foundation; either version 2 of
-   the License, or (at your option) any later version.
+   modify it under the terms of the GNU General Public License
+   version 2 as ammended with additional clauses defined in the
+   file LICENSE in the main source directory.
 
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-   General Public License for more details.
-
-   You should have received a copy of the GNU General Public
-   License along with this program; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-   MA 02111-1307, USA.
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
+   the file LICENSE for additional details.
 
  */
 
 
          if (!dev->poll && jcr->label_errors++ > 100) {
             Jmsg(jcr, M_FATAL, 0, "Too many tries: %s", jcr->errmsg);
          }
+         Dmsg0(100, "return VOL_NAME_ERROR\n");
          return VOL_NAME_ERROR;
       }
       Dmsg0(30, "Leave read_volume_label() VOL_OK\n");
    if (!rewind_dev(dev)) {
       Mmsg(jcr->errmsg, _("Couldn't rewind device %s: ERR=%s\n"), 
          dev->print_name(), strerror_dev(dev));
-      Dmsg1(30, "%s", jcr->errmsg);
+      Dmsg1(30, "return VOL_NO_MEDIA: %s", jcr->errmsg);
       return VOL_NO_MEDIA;
    }
    bstrncpy(dev->VolHdr.Id, "**error**", sizeof(dev->VolHdr.Id));
          }
          empty_block(block);
          rewind_dev(dev);
+         Dmsg1(100, "return %d\n", stat);
          return stat;
       }
       if (stat != VOL_OK) {           /* Not an ANSI/IBM label, so re-read */
          return VOL_OK;
       }
       rewind_dev(dev);
+      Dmsg0(100, "return VOL_NO_LABEL\n");
       return VOL_NO_LABEL;
    }
 
        dev->VolHdr.VerNum != OldCompatibleBaculaTapeVersion2) {
       Mmsg(jcr->errmsg, _("Volume on %s has wrong Bacula version. Wanted %d got %d\n"),
          dev->print_name(), BaculaTapeVersion, dev->VolHdr.VerNum);
-      Dmsg1(30, "%s", jcr->errmsg);
+      Dmsg1(30, "VOL_VERSION_ERROR: %s", jcr->errmsg);
       return VOL_VERSION_ERROR;
    }
 
       if (!dev->poll && jcr->label_errors++ > 100) {
          Jmsg(jcr, M_FATAL, 0, "Too many tries: %s", jcr->errmsg);
       }
+      Dmsg0(100, "return VOL_LABEL_ERROR\n");
       return VOL_LABEL_ERROR;
    }
 
       if (!dev->poll && jcr->label_errors++ > 100) {
          Jmsg(jcr, M_FATAL, 0, "Too many tries: %s", jcr->errmsg);
       }
+      Dmsg0(100, "return VOL_NAME_ERROR\n");
       return VOL_NAME_ERROR;
    }
    Dmsg1(30, "Copy vol_name=%s\n", dev->VolHdr.VolumeName);
 
       return false;
    }
 
-   Dmsg2(100, "dirVol=%s dirStat=%s\n", dcr->VolumeName,
+   Dmsg2(100, "Want dirVol=%s dirStat=%s\n", dcr->VolumeName,
       dcr->VolCatInfo.VolCatStatus);
    /*
     * At this point, dev->VolCatInfo has what is in the drive, if anything,
       memcpy(&VolCatInfo, &dcr->VolCatInfo, sizeof(VolCatInfo));
       memcpy(&devVolCatInfo, &dev->VolCatInfo, sizeof(devVolCatInfo));
       /* Check if this is a valid Volume in the pool */
+      bstrncpy(dcr->VolumeName, dev->VolHdr.VolumeName, sizeof(dcr->VolumeName));
       if (!dir_get_volume_info(dcr, GET_VOL_INFO_FOR_WRITE)) {
          /* Restore desired volume name, note device info out of sync */
          /* This gets the info regardless of the Pool */
 
 /* */
 #undef  VERSION
-#define VERSION "1.37.24"
-#define BDATE   "18 June 2005"
-#define LSMDATE "18Jun05"
+#define VERSION "1.37.25"
+#define BDATE   "20 June 2005"
+#define LSMDATE "20Jun05"
 
 /* Debug flags */
 #undef  DEBUG
 #define TRACE_FILE 1
 
 /* If this is set stdout will not be closed on startup */
-/* #define DEVELOPER 1 */
+#define DEVELOPER 1