diff options
Diffstat (limited to 'c/src/exec/libcsupport/src/lseek.c')
-rw-r--r-- | c/src/exec/libcsupport/src/lseek.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/c/src/exec/libcsupport/src/lseek.c b/c/src/exec/libcsupport/src/lseek.c index 910b81d231..af41116346 100644 --- a/c/src/exec/libcsupport/src/lseek.c +++ b/c/src/exec/libcsupport/src/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; } |