mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +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
|
||||
return -1;
|
||||
// EOF reached
|
||||
if (ret == 0)
|
||||
return total;
|
||||
// If anything was read, accumulate it, and continue
|
||||
// If anything was written, accumulate it, and continue
|
||||
if (ret != -1) {
|
||||
total += ret;
|
||||
len -= ret;
|
||||
buf += ret;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user