Interestingly, a call to fseek with a NULL file handle now blocks forever...
Change-Id: Ic80c579abcf2bdb73f7fd1da713649b7c7f25f56
This commit is contained in:
@@ -45,6 +45,10 @@ status_t FileSource::initCheck() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ssize_t FileSource::readAt(off_t offset, void *data, size_t size) {
|
ssize_t FileSource::readAt(off_t offset, void *data, size_t size) {
|
||||||
|
if (mFile == NULL) {
|
||||||
|
return NO_INIT;
|
||||||
|
}
|
||||||
|
|
||||||
Mutex::Autolock autoLock(mLock);
|
Mutex::Autolock autoLock(mLock);
|
||||||
|
|
||||||
if (mLength >= 0) {
|
if (mLength >= 0) {
|
||||||
@@ -67,6 +71,10 @@ ssize_t FileSource::readAt(off_t offset, void *data, size_t size) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
status_t FileSource::getSize(off_t *size) {
|
status_t FileSource::getSize(off_t *size) {
|
||||||
|
if (mFile == NULL) {
|
||||||
|
return NO_INIT;
|
||||||
|
}
|
||||||
|
|
||||||
if (mLength >= 0) {
|
if (mLength >= 0) {
|
||||||
*size = mLength;
|
*size = mLength;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user