tfc_say(" Note that both sync and lsync work only with read errors!");
tfc_say(" default error action is exit with printing status if not quiet.");
tfc_say(" -E xall: turn on error actions above for all errors, not just EIO errors.");
- tfc_say(" This must be a separate option given before usual -E how option.");
+ tfc_say(" -E xseek: ignore positioning and other seek related errors.");
+ tfc_say(" Multiple -E specifiers may be given in separate options.");
tfc_say(" -O opts: set options (comma separated list):");
tfc_say(" sync: request a synchronous I/O for a output,");
tfc_say(" fsync: on each write() call a corresponding fsync(fd),");
if (offset) {
if (lseek(fd, offset, SEEK_SET) == -1)
- xerror(YES, NO, NO, "%s: seek failed", foutname);
+ xerror(ignore_seek_errors, NO, NO, "%s: seek failed", foutname);
}
if (ctr_mode == TFC_MODE_PLAIN) memset(srcblk, 0, sizeof(srcblk));
if (readto == NOFSIZE) goto _fail;
}
if (offset != 0 && offset != NOFSIZE) {
- if (lseek(fd, (off_t)offset, SEEK_SET) == -1) goto _fail;
+ if (lseek(fd, (off_t)offset, SEEK_SET) == -1) {
+ if (ignore_seek_errors == NO) goto _fail;
+ }
}
}
int do_edcrypt = TFC_DO_ENCRYPT, do_stop, quiet, error_action;
int counter_opt, mackey_opt, do_mac, do_outfmt = TFC_OUTFMT_B64, rawkey;
int idx, write_flags;
-tfc_yesno catch_all_errors, password, overwrite_source, do_fsync, do_pad, do_tfcrypt1;
+tfc_yesno catch_all_errors, ignore_seek_errors, password, overwrite_source, do_fsync, do_pad, do_tfcrypt1;
tfc_yesno do_preserve_time, do_stats_in_gibs, do_statline_dynamic = YES, do_less_stats;
tfc_yesno no_repeat, do_full_hexdump = YES, verbose, statline_was_shown;
char *srcfname = TFC_STDIN_NAME, *dstfname = TFC_STDOUT_NAME, *do_mac_file, *counter_file, *sksum_hashlist_file;
catch_all_errors = YES;
break;
}
+ if (!strcmp(optarg, "xseek")) {
+ ignore_seek_errors = YES;
+ break;
+ }
if (!strcmp(optarg, "exit"))
error_action = TFC_ERRACT_EXIT;
else if (!strncmp(optarg, "cont", 4))
if (counter_opt == TFC_CTR_HEAD && ctr_mode != TFC_MODE_ECB)
iseek += ctrsz;
if (lseek(sfd, iseek, SEEK_SET) == -1)
- xerror(YES, NO, NO, "%s: seek failed", srcfname);
+ xerror(ignore_seek_errors, NO, NO, "%s: seek failed", srcfname);
}
if (ctr_mode == TFC_MODE_PLAIN) goto _plain;
if (oseek) {
if (lseek(dfd, oseek, SEEK_SET) == -1)
- xerror(YES, NO, NO, "%s: seek failed", dstfname);
+ xerror(ignore_seek_errors, NO, NO, "%s: seek failed", dstfname);
}
for (x = 1; x < NSIG; x++) signal(x, SIG_IGN);
extern int do_edcrypt, do_stop, quiet, error_action;
extern int counter_opt, mackey_opt, do_mac, do_outfmt, rawkey;
extern int idx, write_flags;
-extern tfc_yesno catch_all_errors, password, overwrite_source, do_fsync, do_pad, do_tfcrypt1;
+extern tfc_yesno catch_all_errors, ignore_seek_errors, password, overwrite_source, do_fsync, do_pad, do_tfcrypt1;
extern tfc_yesno do_preserve_time, do_stats_in_gibs, do_statline_dynamic, do_less_stats;
extern tfc_yesno no_repeat, do_full_hexdump, verbose, statline_was_shown;
extern char *srcfname, *dstfname, *do_mac_file, *counter_file, *sksum_hashlist_file;