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
commit 959c8f287c
Notes: sideshowbarker 2024-07-19 14:01:54 +09:00

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;