From a37e9ca8409c638f6473fc5e15e7663d4806bfbd Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Sun, 4 May 2008 20:18:15 +0000 Subject: [PATCH] ebl update git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@6891 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/patches/testing/faketape.c | 11 +++++------ bacula/patches/testing/t.c | 19 ++++++++++++++++++- 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/bacula/patches/testing/faketape.c b/bacula/patches/testing/faketape.c index 65792a985d..962faf86bb 100644 --- a/bacula/patches/testing/faketape.c +++ b/bacula/patches/testing/faketape.c @@ -232,7 +232,7 @@ int faketape::tape_op(struct mtop *mt_com) atEOF = true; atEOD = true; close_file(); - current_file = last_file; + current_file = last_file+1; current_block = -1; /* Ne pas creer le fichier si on est a la fin */ @@ -575,22 +575,21 @@ int faketape::fsr(int count) check_file(); + /* check all block record */ for(i=0; (i < count) && (where != -1) ; i++) { - Dmsg3(dbglevel," fsr ok count=%i i=%i where=%i\n", count, i, where); - nb = ::read(cur_fd, &size, sizeof(size)); + nb = ::read(cur_fd, &size, sizeof(size)); /* get size of block */ if (nb == sizeof(size)) { - where = lseek(cur_fd, size, SEEK_CUR); + current_block++; + where = lseek(cur_fd, size, SEEK_CUR); /* seek after this block */ if (where == -1) { errno = EIO; return -1; } - current_block++; } else { errno = EIO; return -1; } } - Dmsg2(dbglevel," fsr ok i=%i where=%i\n", i, where); return 0; } diff --git a/bacula/patches/testing/t.c b/bacula/patches/testing/t.c index 64b7f47761..ca9c2cdf58 100644 --- a/bacula/patches/testing/t.c +++ b/bacula/patches/testing/t.c @@ -45,6 +45,18 @@ int main() printf("write something (3 writes)\n"); print_pos(); + /* write EOF */ + printf("WEOF\n"); + mt_com.mt_op = MTWEOF; + mt_com.mt_count = 1; + r1 = ioctl(fd, MTIOCTOP, &mt_com); + print_pos(); + + /* write a second file */ + write(fd, "abcdefghijklmnopqrstuvwyz", strlen("abcdefghijklmnopqrstuvwyz")+1); + printf("write something\n"); + print_pos(); + /* rewind */ mt_com.mt_count = 1; mt_com.mt_op = MTREW; @@ -135,7 +147,12 @@ int main() r1 = ioctl(fd, MTIOCTOP, &mt_com); printf("goto eom\n"); print_pos(); - + + /* write something */ + printf("write something\n"); + write(fd, "abcdefghijklmnopqrstuvwyz", strlen("abcdefghijklmnopqrstuvwyz")+1); + print_pos(); + close(fd); return(0); } -- 2.39.2