summaryrefslogtreecommitdiff
path: root/Kernel
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-02-29 18:42:35 +0100
committerAndreas Kling <kling@serenityos.org>2020-02-29 18:42:35 +0100
commit4badef8137395bec128fdd58ebe471a873bac84f (patch)
tree8804b87e5924a5dab7d07d876a97deae00489e09 /Kernel
parent70b940c307c4fca95ca95a08b4aa79dc64a4003b (diff)
downloadserenity-4badef8137395bec128fdd58ebe471a873bac84f.zip
Kernel: Return bytes written if sys$write() fails after writing some
If we wrote anything we should just inform userspace that we did, and not worry about the error code. Userspace can call us again if it wants, and we'll give them the error then.
Diffstat (limited to 'Kernel')
-rw-r--r--Kernel/Process.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Kernel/Process.cpp b/Kernel/Process.cpp
index 204b73fd4f..2adee8f203 100644
--- a/Kernel/Process.cpp
+++ b/Kernel/Process.cpp
@@ -1695,8 +1695,8 @@ ssize_t Process::do_write(FileDescription& description, const u8* data, int data
dbg() << " -> write returned " << rc;
#endif
if (rc < 0) {
- // FIXME: Support returning partial nwritten with errno.
- ASSERT(nwritten == 0);
+ if (nwritten)
+ return nwritten;
return rc;
}
if (rc == 0)