return;
}
- if (archive_name.c_str()[strlen(archive_name.c_str())-1] != '/') {
+ if (!IsPathSeparator(archive_name.c_str()[strlen(archive_name.c_str())-1])) {
pm_strcat(archive_name, "/");
}
pm_strcat(archive_name, VolCatInfo.VolCatName);
break;
}
} else if (is_file() || is_dvd()) {
- if (lseek(dcr, (off_t)0, SEEK_SET) < 0) {
+ if (lseek(dcr, (boffset_t)0, SEEK_SET) < 0) {
berrno be;
dev_errno = errno;
Mmsg2(errmsg, _("lseek error on %s. ERR=%s.\n"),
struct mtop mt_com;
struct mtget mt_stat;
bool ok = true;
- off_t pos;
+ boffset_t pos;
if (fd < 0) {
dev_errno = EBADF;
return true;
}
if (!is_tape()) {
- pos = lseek(dcr, (off_t)0, SEEK_END);
+ pos = lseek(dcr, (boffset_t)0, SEEK_END);
// Dmsg1(100, "====== Seek to %lld\n", pos);
if (pos >= 0) {
update_pos(dcr);
*/
bool DEVICE::update_pos(DCR *dcr)
{
- off_t pos;
+ boffset_t pos;
bool ok = true;
if (!is_open()) {
if (is_file() || is_dvd()) {
file = 0;
file_addr = 0;
- pos = lseek(dcr, (off_t)0, SEEK_CUR);
+ pos = lseek(dcr, (boffset_t)0, SEEK_CUR);
if (pos < 0) {
berrno be;
dev_errno = errno;
}
if (!is_tape()) {
- off_t pos = (((off_t)rfile)<<32) + (off_t)rblock;
+ boffset_t pos = (((boffset_t)rfile)<<32) | rblock;
Dmsg1(100, "===== lseek to %d\n", (int)pos);
- if (lseek(dcr, pos, SEEK_SET) == (off_t)-1) {
+ if (lseek(dcr, pos, SEEK_SET) == (boffset_t)-1) {
berrno be;
dev_errno = errno;
Mmsg2(errmsg, _("lseek error on %s. ERR=%s.\n"),
dcr->VolCatInfo = saveVolCatInfo; /* structure assignment */
}
-off_t DEVICE::lseek(DCR *dcr, off_t offset, int whence)
+boffset_t DEVICE::lseek(DCR *dcr, boffset_t offset, int whence)
{
switch (dev_type) {
case B_DVD_DEV:
return lseek_dvd(dcr, offset, whence);
case B_FILE_DEV:
- return ::lseek(fd, offset, whence);
- }
+#if defined(HAVE_WIN32)
+ return ::_lseeki64(fd, (__int64)offset, whence);
+#else
+ return ::lseek(fd, (off_t)offset, whence);
+#endif
+ }
return -1;
}