1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 19:55:10 +00:00

FileDescriptor: It's actually okay to seek past the end of a file. :^)

This commit is contained in:
Andreas Kling 2019-05-18 21:54:31 +02:00
parent 7900da9667
commit 959c8f287c

View file

@ -150,8 +150,9 @@ off_t FileDescriptor::seek(off_t offset, int whence)
return -EINVAL;
}
if (newOffset < 0 || newOffset > metadata.size)
if (newOffset < 0)
return -EINVAL;
// FIXME: Return -EINVAL if attempting to seek past the end of a seekable device.
m_current_offset = newOffset;
return m_current_offset;