Change default seek behavior: error out, allow to ignore errors with -E xseek.
[tfcrypt.git] / tfc_skein.c
index fe86c20de71b1c595aa15e5e2d489223d1766d71..5d457deac828513156db13ced328d11feb6ef9e7 100644 (file)
@@ -68,7 +68,9 @@ tfc_yesno skeinfd(void *hash, size_t bits, const void *key, int fd, tfc_fsize of
                        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;
+                       }
                }
        }