get actual return value from ::write()

This commit is contained in:
Jorj Bauer 2020-08-01 20:42:13 -04:00
parent 85993b903e
commit 0c2cf3f8ff
1 changed files with 3 additions and 3 deletions

View File

@ -210,9 +210,9 @@ int NixFileManager::write(int8_t fd, const void *buf, int nbyte)
close(ffd);
return -1;
}
ret = ::write(ffd, buf, nbyte);
if (ret != nbyte) {
printf("error writing: %d\n", errno);
ssize_t rv = ::write(ffd, buf, nbyte);
if (rv != nbyte) {
printf("error writing: %d; wanted to write %d got %d\n", errno, nbyte, ret);
}
close(ffd);
} else {