Skip to content

Commit

Permalink
Kernel: Return bytes written if sys$write() fails after writing some
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
awesomekling committed Feb 29, 2020
1 parent 70b940c commit 4badef8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Kernel/Process.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 4badef8

Please sign in to comment.