mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 18:22:07 +00:00
Fix RGBFIX writing bytes when one syscall is not sufficient
This commit is contained in:
@@ -805,13 +805,11 @@ static ssize_t writeBytes(int fd, uint8_t *buf, size_t len) {
|
|||||||
|
|
||||||
if (ret == -1 && errno != EINTR) // Return errors, unless we only were interrupted
|
if (ret == -1 && errno != EINTR) // Return errors, unless we only were interrupted
|
||||||
return -1;
|
return -1;
|
||||||
// EOF reached
|
// If anything was written, accumulate it, and continue
|
||||||
if (ret == 0)
|
|
||||||
return total;
|
|
||||||
// If anything was read, accumulate it, and continue
|
|
||||||
if (ret != -1) {
|
if (ret != -1) {
|
||||||
total += ret;
|
total += ret;
|
||||||
len -= ret;
|
len -= ret;
|
||||||
|
buf += ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user