From d3957cc89d4de6e1d0f5ec2b79298be99159c11b Mon Sep 17 00:00:00 2001 From: Hector Martin Date: Sat, 17 Apr 2021 16:28:07 +0900 Subject: [PATCH] iodev: Fix error returns for iodev_read/write Signed-off-by: Hector Martin --- src/iodev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/iodev.c b/src/iodev.c index febb7cd3..9e421d07 100644 --- a/src/iodev.c +++ b/src/iodev.c @@ -46,7 +46,7 @@ bool iodev_can_write(iodev_id_t id) ssize_t iodev_read(iodev_id_t id, void *buf, size_t length) { if (!iodevs[id]->ops->read) - return false; + return -1; return iodevs[id]->ops->read(iodevs[id]->opaque, buf, length); } @@ -54,7 +54,7 @@ ssize_t iodev_read(iodev_id_t id, void *buf, size_t length) ssize_t iodev_write(iodev_id_t id, const void *buf, size_t length) { if (!iodevs[id]->ops->write) - return false; + return -1; return iodevs[id]->ops->write(iodevs[id]->opaque, buf, length); }