libroot/unistd: Fix write truncating return values of _kern_write.
ssize_t is 64-bit on 64-bit architectures, if we truncate to int then values above 2GB will be seen as negative and errors instead of the successes they are. Seems to fix #16861.
This commit is contained in:
@@ -21,7 +21,7 @@
|
|||||||
ssize_t
|
ssize_t
|
||||||
write(int fd, void const *buffer, size_t bufferSize)
|
write(int fd, void const *buffer, size_t bufferSize)
|
||||||
{
|
{
|
||||||
int status = _kern_write(fd, -1, buffer, bufferSize);
|
ssize_t status = _kern_write(fd, -1, buffer, bufferSize);
|
||||||
|
|
||||||
RETURN_AND_SET_ERRNO_TEST_CANCEL(status);
|
RETURN_AND_SET_ERRNO_TEST_CANCEL(status);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user