]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/stored/btape.c
Additional message plus exclusion fix
[bacula/bacula] / bacula / src / stored / btape.c
index ce91e5cd45766097af0dde53c5d13a67c355882d..8bac101d7ccb1925ce718e5afd8c8ee06f001be9 100644 (file)
@@ -14,7 +14,7 @@
  *
  */
 /*
-   Copyright (C) 2000, 2001, 2002 Kern Sibbald and John Walker
+   Copyright (C) 2000-2003 Kern Sibbald and John Walker
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
@@ -1043,8 +1043,8 @@ This may take a long time. I.e. hours! ...\n\n");
     *  subroutine.
     */
    Dmsg0(100, "just before acquire_device\n");
-   if (!acquire_device_for_append(jcr, dev, block)) {
-      jcr->JobStatus = JS_Cancelled;
+   if (!(dev=acquire_device_for_append(jcr, dev, block))) {
+      set_jcr_job_status(jcr, JS_ErrorTerminated);
       free_block(block);
       return;
    }
@@ -1054,7 +1054,7 @@ This may take a long time. I.e. hours! ...\n\n");
     * Write Begin Session Record
     */
    if (!write_session_label(jcr, block, SOS_LABEL)) {
-      jcr->JobStatus = JS_Cancelled;
+      set_jcr_job_status(jcr, JS_ErrorTerminated);
       Jmsg1(jcr, M_FATAL, 0, _("Write session label failed. ERR=%s\n"),
         strerror_dev(dev));
       ok = FALSE;
@@ -1146,9 +1146,9 @@ This may take a long time. I.e. hours! ...\n\n");
       Dmsg0(000, "Write_end_session_label()\n");
       /* Create Job status for end of session label */
       if (!job_cancelled(jcr) && ok) {
-        jcr->JobStatus = JS_Terminated;
+        set_jcr_job_status(jcr, JS_Terminated);
       } else if (!ok) {
-        jcr->JobStatus = JS_ErrorTerminated;
+        set_jcr_job_status(jcr, JS_ErrorTerminated);
       }
       if (!write_session_label(jcr, block, EOS_LABEL)) {
          Pmsg1(000, _("Error writting end session label. ERR=%s\n"), strerror_dev(dev));
@@ -1437,7 +1437,6 @@ static struct cmdstruct commands[] = {
  {"cap",        capcmd,       "list device capabilities"},
  {"clear",      clearcmd,     "clear tape errors"},
  {"eod",        eodcmd,       "go to end of Bacula data for append"},
- {"test",       testcmd,      "General test Bacula tape functions"},
  {"eom",        eomcmd,       "go to the physical end of medium"},
  {"fill",       fillcmd,      "fill tape, write onto second volume"},
  {"unfill",     unfillcmd,    "read filled tape"},
@@ -1453,6 +1452,7 @@ static struct cmdstruct commands[] = {
  {"rewind",     rewindcmd,    "rewind the tape"},
  {"scan",       scancmd,      "read tape block by block to EOT and report"}, 
  {"status",     statcmd,      "print tape status"},
+ {"test",       testcmd,      "General test Bacula tape functions"},
  {"weof",       weofcmd,      "write an EOF on the tape"},
  {"wr",         wrcmd,        "write a single record of 2048 bytes"}, 
             };
@@ -1493,7 +1493,7 @@ static void helpcmd()
 static void usage()
 {
    fprintf(stderr, _(
-"\nVersion: " VERSION " (" DATE ")\n\n"
+"\nVersion: " VERSION " (" BDATE ")\n\n"
 "Usage: btape [-c config_file] [-d debug_level] [device_name]\n"
 "       -c <file>   set configuration file to file\n"
 "       -dnn        set debug level to nn\n"