mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:57:35 +00:00
Kernel: Support write() after setting O_APPEND on a non-seekable file
Previously, Process::do_write would error if the O_APPEND flag was set on a non-seekable file. Other systems (such as Linux) seem to be OK with doing this, so we now do not attempt to seek to the end the file if it's not seekable.
This commit is contained in:
parent
9eaa6527f7
commit
ba0df27653
1 changed files with 1 additions and 1 deletions
|
@ -84,7 +84,7 @@ KResultOr<ssize_t> Process::do_write(FileDescription& description, const UserOrK
|
|||
return EAGAIN;
|
||||
}
|
||||
|
||||
if (description.should_append()) {
|
||||
if (description.should_append() && description.file().is_seekable()) {
|
||||
auto seek_result = description.seek(0, SEEK_END);
|
||||
if (seek_result.is_error())
|
||||
return seek_result.error();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue