mirror of
https://github.com/upx/upx
synced 2025-09-28 19:06:07 +08:00
src: restore lseek() error check in file.cpp
This commit is contained in:
parent
1bed77e4d3
commit
1eb6a40fdd
|
@ -135,7 +135,7 @@ upx_off_t FileBase::seek(upx_off_t off, int whence) {
|
|||
}
|
||||
// SEEK_CUR falls through to here
|
||||
upx_off_t rv = ::lseek(_fd, off, whence);
|
||||
if (0 == (1+ rv)) // lazy coding to check for "-1" failure of ::lseek
|
||||
if (rv < 0)
|
||||
throwIOException("seek error", errno);
|
||||
return rv - _offset;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user