summaryrefslogtreecommitdiff
path: root/generic/Input.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'generic/Input.cpp')
-rw-r--r--generic/Input.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/generic/Input.cpp b/generic/Input.cpp
index ffef9f0..1cb6e2e 100644
--- a/generic/Input.cpp
+++ b/generic/Input.cpp
@@ -61,10 +61,13 @@ time_t Input::GetModif() {
return date_modif;
}
-off_t Input::seek(off_t offset, int whence) {
- itell = lseek(GetHandle(), offset, whence);
+off_t Input::seek(off_t offset, int whence) throw (GeneralException) {
+ if ((itell = lseek(GetHandle(), offset, whence)) < 0) {
+ throw IOGereral(String(_("Error seeking file ")) + no + _(": ") + strerror(errno));
+ }
#ifdef PARANOID_SEEK
if (itell != lseek(GetHandle(), 0, SEEK_CUR)) {
+ throw IOGereral(String(_("Error seeking file ")) + no + _(": the position does not match"));
}
#endif
}