2 This patch fixes bcopy so that it produces correct Volumes.
5 Apply this patch to version 2.2.6 and possibly any 2.2.x version with:
8 patch -p0 2.2.6-bcopy.patch
9 ./configure <your-options>
15 Index: src/stored/bcopy.c
16 ===================================================================
17 --- src/stored/bcopy.c (revision 6010)
18 +++ src/stored/bcopy.c (working copy)
20 char *iVolumeName = NULL;
21 char *oVolumeName = NULL;
22 bool ignore_label_errors = false;
25 setlocale(LC_ALL, "");
26 bindtextdomain("bacula", LOCALEDIR);
29 out_block = out_jcr->dcr->block;
31 - read_records(in_jcr->dcr, record_cb, mount_next_read_volume);
32 - if (!write_block_to_device(out_jcr->dcr)) {
33 - Pmsg0(000, _("Write of last block failed.\n"));
34 + ok = read_records(in_jcr->dcr, record_cb, mount_next_read_volume);
35 + if (ok || out_dev->can_write()) {
36 + if (!write_block_to_device(out_jcr->dcr)) {
37 + Pmsg0(000, _("Write of last block failed.\n"));
41 Pmsg2(000, _("%u Jobs copied. %u records copied.\n"), jobs, records);
43 out_dev->print_name(), out_dev->bstrerror());
44 Jmsg(out_jcr, M_FATAL, 0, _("Cannot fixup device error. %s\n"),
45 out_dev->bstrerror());
49 if (!write_block_to_device(out_jcr->dcr)) {
51 out_dev->print_name(), out_dev->bstrerror());
52 Jmsg(out_jcr, M_FATAL, 0, _("Cannot fixup device error. %s\n"),
53 out_dev->bstrerror());
59 Pmsg0(000, _("EOM label not copied.\n"));
62 Pmsg0(000, _("EOT label not copied.\n"));
71 out_dev->print_name(), out_dev->bstrerror());
72 Jmsg(out_jcr, M_FATAL, 0, _("Cannot fixup device error. %s\n"),
73 out_dev->bstrerror());