mirror of
https://github.com/SerenityOS/serenity
synced 2024-10-15 20:33:10 +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
|
@ -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…
Reference in a new issue