|
|
@ -94,7 +94,7 @@ long MMapFile::write(const char*, long) {
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool MMapFile::seek(long to, int whence) {
|
|
|
|
ssize_t MMapFile::seek(long to, int whence) {
|
|
|
|
if(!handle) return false;
|
|
|
|
if(!handle) return false;
|
|
|
|
|
|
|
|
|
|
|
|
long newpos = 0;
|
|
|
|
long newpos = 0;
|
|
|
@ -109,12 +109,12 @@ bool MMapFile::seek(long to, int whence) {
|
|
|
|
newpos = len + to;
|
|
|
|
newpos = len + to;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
return false;
|
|
|
|
return length();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (newpos > len || newpos < 0)
|
|
|
|
if (newpos > len || newpos < 0)
|
|
|
|
return false;
|
|
|
|
return -1;
|
|
|
|
pos = newpos;
|
|
|
|
pos = newpos;
|
|
|
|
return true;
|
|
|
|
return newpos;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
long MMapFile::position() const {
|
|
|
|
long MMapFile::position() const {
|
|
|
|