]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/stored/read.c
kes Fix logic error in handling error return from mtx-changer
[bacula/bacula] / bacula / src / stored / read.c
index a02c70d757eedba8693dd3782ad9fd9cb3eed6ec..412b4a20b73e214a2f15ed4ad03b38479ee81663 100644 (file)
@@ -6,11 +6,11 @@
  *   Version $Id$
  */
 /*
-   Copyright (C) 2000-2005 Kern Sibbald
+   Copyright (C) 2000-2006 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
-   version 2 as ammended with additional clauses defined in the
+   version 2 as amended 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,
@@ -41,7 +41,7 @@ bool do_read_data(JCR *jcr)
 {
    BSOCK *fd = jcr->file_bsock;
    bool ok = true;
-   DCR *dcr = jcr->dcr;
+   DCR *dcr = jcr->read_dcr;
 
    Dmsg0(20, "Start read data.\n");
 
@@ -75,7 +75,7 @@ bool do_read_data(JCR *jcr)
    /* Send end of data to FD */
    bnet_sig(fd, BNET_EOD);
 
-   if (!release_device(dcr)) {
+   if (!release_device(jcr->read_dcr)) {
       ok = false;
    }
 
@@ -99,19 +99,19 @@ static bool record_cb(DCR *dcr, DEV_RECORD *rec)
    if (rec->FileIndex < 0) {
       return true;
    }
-   Dmsg5(100, "Send to FD: SessId=%u SessTim=%u FI=%d Strm=%d, len=%d\n",
+   Dmsg5(400, "Send to FD: SessId=%u SessTim=%u FI=%d Strm=%d, len=%d\n",
       rec->VolSessionId, rec->VolSessionTime, rec->FileIndex, rec->Stream,
       rec->data_len);
 
    /* Send record header to File daemon */
    if (!bnet_fsend(fd, rec_header, rec->VolSessionId, rec->VolSessionTime,
           rec->FileIndex, rec->Stream, rec->data_len)) {
-      Dmsg1(30, ">filed: Error Hdr=%s\n", fd->msg);
+      Pmsg1(000, _(">filed: Error Hdr=%s\n"), fd->msg);
       Jmsg1(jcr, M_FATAL, 0, _("Error sending to File daemon. ERR=%s\n"),
          bnet_strerror(fd));
       return false;
    } else {
-      Dmsg1(31, ">filed: Hdr=%s\n", fd->msg);
+      Dmsg1(400, ">filed: Hdr=%s\n", fd->msg);
    }
 
 
@@ -119,9 +119,9 @@ static bool record_cb(DCR *dcr, DEV_RECORD *rec)
    save_msg = fd->msg;          /* save fd message pointer */
    fd->msg = rec->data;         /* pass data directly to bnet_send */
    fd->msglen = rec->data_len;
-   Dmsg1(31, ">filed: send %d bytes data.\n", fd->msglen);
+   Dmsg1(400, ">filed: send %d bytes data.\n", fd->msglen);
    if (!bnet_send(fd)) {
-      Pmsg1(000, "Error sending to FD. ERR=%s\n", bnet_strerror(fd));
+      Pmsg1(000, _("Error sending to FD. ERR=%s\n"), bnet_strerror(fd));
       Jmsg1(jcr, M_FATAL, 0, _("Error sending to File daemon. ERR=%s\n"),
          bnet_strerror(fd));