Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c21c1900 authored by Andreas Huber's avatar Andreas Huber Committed by Android Git Automerger
Browse files

am ec5f8241: am cbcf8f63: Interestingly, a call to fseek with a NULL file...

am ec5f8241: am cbcf8f63: Interestingly, a call to fseek with a NULL file handle now blocks forever...
parents 8c8634b5 ec5f8241
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -45,6 +45,10 @@ status_t FileSource::initCheck() const {
}

ssize_t FileSource::readAt(off_t offset, void *data, size_t size) {
    if (mFile == NULL) {
        return NO_INIT;
    }

    Mutex::Autolock autoLock(mLock);

    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) {
    if (mFile == NULL) {
        return NO_INIT;
    }

    if (mLength >= 0) {
        *size = mLength;