summaryrefslogtreecommitdiffstats
path: root/c/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'c/src/lib')
-rw-r--r--c/src/lib/libc/lseek.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/c/src/lib/libc/lseek.c b/c/src/lib/libc/lseek.c
index 910b81d231..af41116346 100644
--- a/c/src/lib/libc/lseek.c
+++ b/c/src/lib/libc/lseek.c
@@ -68,14 +68,13 @@ off_t lseek(
*/
status = (*iop->handlers->lseek_h)( iop, offset, whence );
- if ( !status )
- return 0;
+ if ( status == (off_t) -1 )
+ iop->offset = old_offset;
/*
* So if the operation failed, we have to restore iop->offset.
*/
- iop->offset = old_offset;
return status;
}