From f1ea810394d8fea1775dbf33070e96a0f4ba2997 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Sun, 26 Jun 2022 12:02:32 +0000 Subject: [PATCH] changed hio_dev_read() to change the multiplexer state even if the input side is known to be closed --- hio/lib/hio.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hio/lib/hio.c b/hio/lib/hio.c index e5150d6..8a3fcda 100644 --- a/hio/lib/hio.c +++ b/hio/lib/hio.c @@ -1367,11 +1367,16 @@ static int __dev_read (hio_dev_t* dev, int enabled, const hio_ntime_t* tmout, vo { hio_t* hio = dev->hio; + /* __dev_read() doesn't perform 'read' unlike __dev_write() that actually writes. + * it only changes the multiplexer state. it may be ok to allow this state change + * request even if HIO_DEV_CAP_IN_CLOSED is set. therefore, the condtion like this + * is not implemented in this function. if (dev->dev_cap & HIO_DEV_CAP_IN_CLOSED) { hio_seterrbfmt (hio, HIO_ENOCAPA, "unable to read closed device"); return -1; } + */ if (enabled) {