]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/stored/btape.c
Add address and socket for MySQL
[bacula/bacula] / bacula / src / stored / btape.c
index 4d5c6cf108911462e99b5bf6817d9b0f5a7e29a2..e60ad718acf0870e5e3fa6d74342caf5b74d99dd 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
@@ -206,7 +206,7 @@ int main(int argc, char *argv[])
       exit(1);
    }
 
-   jcr = setup_jcr("btape", argv[0], bsr);
+   jcr = setup_jcr("btape", argv[0], bsr, NULL);
    dev = setup_to_access_device(jcr, 0);     /* acquire for write */
    if (!dev) {
       exit(1);
@@ -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));
@@ -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"