8316468: os::write incorrectly handles partial write

Reviewed-by: dholmes, shade
This commit is contained in:
Man Cao 2023-09-19 20:06:40 +00:00
parent d19e017d3f
commit 7ce5bd1590

@ -1439,7 +1439,7 @@ bool os::write(int fd, const void *buf, size_t nBytes) {
if (res == OS_ERR) {
return false;
}
buf = (void *)((char *)buf + nBytes);
buf = (void *)((char *)buf + res);
nBytes -= res;
}