From: Eric Bollengier Date: Tue, 6 May 2008 21:09:28 +0000 (+0000) Subject: ebl Update fake tape driver X-Git-Tag: Release-7.0.0~4639 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=2b5b0841041ff9ed3c7324836242444d4f65819a;p=bacula%2Fbacula ebl Update fake tape driver git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@6903 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/patches/testing/faketape.c b/bacula/patches/testing/faketape.c index 581126c70c..3d0e5126a4 100644 --- a/bacula/patches/testing/faketape.c +++ b/bacula/patches/testing/faketape.c @@ -27,8 +27,20 @@ */ /* - * Maximum File Size = 800M - * + +Device { + Name = Drive-1 # + Maximum File Size = 800M + Maximum Volume Size = 3G + Device Type = TAPE + Archive Device = /tmp/fake + Media Type = DLT-8000 + AutomaticMount = yes; # when device opened, read it + AlwaysOpen = yes; + RemovableMedia = yes; + RandomAccess = no; +} + */ #include "faketape.h" @@ -127,13 +139,9 @@ int faketape_ioctl(int fd, unsigned long int request, ...) result = t->tape_op(va_arg(argp, mtop *)); } else if (request == MTIOCGET) { result = t->tape_get(va_arg(argp, mtget *)); - } -// -// case MTIOCPOS: -// result = tape_pos(fd, va_arg(argp, mtpos *)); -// break; -// - else { + } else if (request == MTIOCPOS) { + result = t->tape_pos(va_arg(argp, mtpos *)); + } else { errno = ENOTTY; result = -1; } @@ -374,7 +382,12 @@ int faketape::tape_get(struct mtget *mt_get) int faketape::tape_pos(struct mtpos *mt_pos) { - return 0; + if (current_block >= 0) { + mt_pos->mt_blkno = current_block; + return 0; + } + + return -1; } /*