+ last2 = last;
+@@ -674,14 +763,14 @@
+ lseek(fd, last2, SEEK_SET);
+ current_file = last_f;
+ current_block = last_b - 1;
+- Dmsg3(dbglevel, "set offset2=%lli %i:%i\n",
++ Dmsg3(dbglevel, "1 set offset2=%lli %i:%i\n",
+ last, current_file, current_block);
+
+ } else if (last > 0) {
+ lseek(fd, last, SEEK_SET);
+ current_file = last_f;
+ current_block = last_b;
+- Dmsg3(dbglevel, "set offset=%lli %i:%i\n",
++ Dmsg3(dbglevel, "2 set offset=%lli %i:%i\n",
+ last, current_file, current_block);
+ } else {
+ lseek(fd, orig, SEEK_SET);
+@@ -693,38 +782,45 @@
+ Dmsg2(dbglevel, "bsr %i:%i\n", current_file, current_block);
+ errno=0;
+ atEOT = atEOF = atEOD = false;
+- atBOT = (current_block == 0 && current_file == 0);
++ atBOT = (lseek(fd, 0, SEEK_CUR) - (sizeof(uint32_t)+2*sizeof(off_t))) == 0;
+
+- current_block = -1;
++ if (orig_b == -1) {
++ current_block = orig_b;
++ }
+