Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 10e3d620 authored by Greg Kaiser's avatar Greg Kaiser
Browse files

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
parent 48c35f0c
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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;