Fix RGBFIX writing bytes when one syscall is not sufficient

This commit is contained in:
Rangi42
2024-12-29 13:09:37 -05:00
committed by Eldred Habert
parent d63955eccd
commit b99ce3845e

View File

@@ -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;
}
}