all: final cleanups in preparation for release

This commit is contained in:
Markus F.X.J. Oberhumer
2023-08-03 14:20:35 +02:00
parent 13e5c13695
commit fa364d6ea3
57 changed files with 62 additions and 1087 deletions
+4 -4
View File
@@ -129,10 +129,10 @@ upx_off_t FileBase::seek(upx_off_t off, int whence) {
whence = SEEK_SET;
}
// SEEK_CUR falls through to here
upx_off_t rv = ::lseek(_fd, off, whence);
if (rv < 0)
upx_off_t l = ::lseek(_fd, off, whence);
if (l < 0)
throwIOException("seek error", errno);
return rv - _offset;
return l - _offset;
}
upx_off_t FileBase::tell() const {
@@ -321,7 +321,7 @@ upx_off_t OutputFile::seek(upx_off_t off, int whence) {
void OutputFile::set_extent(upx_off_t offset, upx_off_t length) {
super::set_extent(offset, length);
bytes_written = 0;
if (0 == offset && 0xffffffffLL == length) {
if (0 == offset && 0xffffffffLL == length) { // TODO: check all callers of this method
if (::fstat(_fd, &st) != 0)
throwIOException(_name, errno);
_length = st.st_size - offset;