mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
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.
This commit is contained in:
parent
70b940c307
commit
4badef8137
Notes:
sideshowbarker
2024-07-19 08:58:03 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/4badef81373
1 changed files with 2 additions and 2 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue