dmuserd: Fix error checking

We change read_all() and write_all() to return signed values, so
our negative error return values will be correctly caught.

Test: TreeHugger
Change-Id: I4d03d4475bccb40ae4b84a846966139b34ede2bd
This commit is contained in:
Greg Kaiser 2020-11-19 16:15:48 -08:00
parent 48c35f0cf6
commit 10e3d620b4

View file

@ -76,7 +76,7 @@ struct dm_user_message {
static bool verbose = false;
size_t write_all(int fd, void* buf, size_t len) {
ssize_t write_all(int fd, void* buf, size_t len) {
char* buf_c = (char*)buf;
ssize_t total = 0;
ssize_t once;
@ -94,7 +94,7 @@ size_t write_all(int fd, void* buf, size_t len) {
return total;
}
size_t read_all(int fd, void* buf, size_t len) {
ssize_t read_all(int fd, void* buf, size_t len) {
char* buf_c = (char*)buf;
ssize_t total = 0;
ssize_t once;