/*
Bacula® - The Network Backup Solution
- Copyright (C) 2005-2007 Free Software Foundation Europe e.V.
+ Copyright (C) 2005-2010 Free Software Foundation Europe e.V.
The main author of Bacula is Kern Sibbald, with contributions from
many others, a complete list can be found in the file AUTHORS.
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- Bacula® is a registered trademark of John Walker.
+ Bacula® is a registered trademark of Kern Sibbald.
The licensor of Bacula is the Free Software Foundation Europe
(FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
Switzerland, email:ftf@fsfeurope.org.
*
* Nicolas Boichat, MMV
*
- * Version $Id$
*/
#include "bacula.h"
pm_strcat(archive_name, "/");
}
- pm_strcat(archive_name, dev->VolCatInfo.VolCatName);
+ pm_strcat(archive_name, dev->getVolCatName());
/* if part > 1, append .# to the filename (where # is the part number) */
if (dev->part > 1) {
pm_strcat(archive_name, ".");
}
Dmsg2(20, "Write part: cmd=%s timeout=%d\n", ocmd.c_str(), timeout);
- status = run_program_full_output(ocmd.c_str(), timeout, results.c_str());
+ status = run_program_full_output(ocmd.c_str(), timeout, results.addr());
Dmsg2(20, "Write part status=%d result=%s\n", status, results.c_str());
dev->blank_dvd = false;
Dmsg1(100, "%s\n", dev->errmsg);
dev->dev_errno = EIO;
if (!dev->truncating) {
- mark_volume_in_error(dcr);
+ dcr->mark_volume_in_error();
}
sm_check(__FILE__, __LINE__, false);
return false;
Dmsg6(29, "Enter: == open_next_part part=%d npart=%d dev=%s vol=%s mode=%d file_addr=%d\n",
dev->part, dev->num_dvd_parts, dev->print_name(),
- dev->VolCatInfo.VolCatName, dev->openmode, dev->file_addr);
+ dev->getVolCatName(), dev->openmode, dev->file_addr);
if (!dev->is_dvd()) {
Dmsg1(100, "Device %s is not dvd!!!!\n", dev->print_name());
return -1;
#endif
}
- Dmsg2(400, "Call dev->open(vol=%s, mode=%d)\n", dcr->VolCatInfo.VolCatName,
+ Dmsg2(400, "Call dev->open(vol=%s, mode=%d)\n", dcr->getVolCatName(),
dev->openmode);
/* Open next part. Note, this sets part_size for part opened. */
DEVICE *dev = dcr->dev;
Dmsg5(29, "Enter: ==== open_first_part dev=%s Vol=%s mode=%d num_dvd_parts=%d append=%d\n", dev->print_name(),
- dev->VolCatInfo.VolCatName, dev->openmode, dev->num_dvd_parts, dev->can_append());
+ dev->getVolCatName(), dev->openmode, dev->num_dvd_parts, dev->can_append());
dev->close_part(dcr);
- Dmsg2(400, "Call dev->open(vol=%s, mode=%d)\n", dcr->VolCatInfo.VolCatName,
+ Dmsg2(400, "Call dev->open(vol=%s, mode=%d)\n", dcr->getVolCatName(),
mode);
Dmsg0(100, "Set part=1\n");
dev->part = 1;
break;
case SEEK_CUR:
Dmsg1(400, "lseek_dvd SEEK_CUR to %s\n", edit_int64(offset, ed1));
- if ((pos = lseek(dev->fd(), (off_t)0, SEEK_CUR)) < 0) {
+ if ((pos = lseek(dev->fd(), 0, SEEK_CUR)) < 0) {
Dmsg0(400, "Seek error.\n");
return pos;
}
* right part number, simply seek
*/
if (dev->is_part_spooled() && dev->part > dev->num_dvd_parts) {
- if ((pos = lseek(dev->fd(), (off_t)0, SEEK_END)) < 0) {
+ if ((pos = lseek(dev->fd(), 0, SEEK_END)) < 0) {
return pos;
} else {
Dmsg1(400, "lseek_dvd SEEK_END returns %s\n",
status = stat(archive_name.c_str(), &statp);
if (status == 0 && statp.st_size == 0) {
Dmsg3(100, "Unlink empty part in close call make_dvd_filename. part=%d num=%d vol=%s\n",
- part_save, dev->num_dvd_parts, dev->VolCatInfo.VolCatName);
+ part_save, dev->num_dvd_parts, dev->getVolCatName());
Dmsg1(100, "unlink(%s)\n", archive_name.c_str());
unlink(archive_name.c_str());
if (part_save == dev->part) {
break;
} else {
Dmsg2(99, "check_can_write_on_non_blank_dvd: found %s (versus %s)\n",
- result->d_name, dev->VolCatInfo.VolCatName);
+ result->d_name, dev->getVolCatName());
if (strcmp(result->d_name, ".") && strcmp(result->d_name, "..") &&
strcmp(result->d_name, ".keep")) {
/* Found a file, checking it is empty */
DIR* dp;
struct dirent *entry, *result;
int name_max;
- int len = strlen(dcr->VolCatInfo.VolCatName);
+ int len = strlen(dcr->getVolCatName());
/* Now count the number of parts */
name_max = pathconf(".", _PC_NAME_MAX);
entry = (struct dirent *)malloc(sizeof(struct dirent) + name_max + 1000);
- Dmsg1(100, "Looking for Vol=%s\n", dcr->VolCatInfo.VolCatName);
+ Dmsg1(100, "Looking for Vol=%s\n", dcr->getVolCatName());
for ( ;; ) {
int flen;
bool ignore;
ignore = true;
if (flen >= len) {
result->d_name[len] = 0;
- if (strcmp(dcr->VolCatInfo.VolCatName, result->d_name) == 0) {
+ if (strcmp(dcr->getVolCatName(), result->d_name) == 0) {
num_parts++;
Dmsg1(100, "find_num_dvd_parts: found part: %s\n", result->d_name);
ignore = false;