1
0
Fork 0
mirror of https://gitlab.com/sortix/sortix.git synced 2023-02-13 20:55:38 -05:00

Fix reading /dev/video/fb causing a write instead.

This really fucks stuff up.
This commit is contained in:
Jonas 'Sortie' Termansen 2012-09-08 19:40:22 +02:00
parent c9eb1b2cb3
commit b0807e8c7a
2 changed files with 3 additions and 3 deletions

View file

@ -380,7 +380,7 @@ ssize_t BGADriver::WriteAt(off_t off, const void* buf, size_t count)
if ( (off_t) framesize <= off )
return 0;
if ( framesize < off + count )
count = off - framesize;
count = framesize - off;
Maxsi::Memory::Copy(frame + off, buf, count);
return count;
}
@ -391,7 +391,7 @@ ssize_t BGADriver::ReadAt(off_t off, void* buf, size_t count)
if ( (off_t) framesize <= off )
return 0;
if ( framesize < off + count )
count = off - framesize;
count = framesize - off;
Maxsi::Memory::Copy(buf, frame + off, count);
return count;
}

View file

@ -427,7 +427,7 @@ ssize_t ReadAt(off_t off, void* buf, size_t count)
ScopedLock lock(&videolock);
DriverEntry* drvent = CurrentDriverEntry();
if ( !drvent ) { Error::Set(EINVAL); return -1; }
return drvent->driver->WriteAt(off, buf, count);
return drvent->driver->ReadAt(off, buf, count);
}
} // namespace Video