Files
nuttx/drivers/can
Karel Kočí aa3cf8cb3a nuttx/can: report error and not EOF at the empty FIFO
The empty FIFO can happen only in two cases. Either there is some
inconsistency that made rx_sem ready but buffer is empty (that might
happen if multiple reads are blocked in parallel, or just due to the bug
in the logic), or if close is used. Until now the 0 would be returned
and thus EOF. The error is not EOF and actually it is still possible to
read afterwards. Thus we for sure should not signal EOF for the first
cause. The second cause for close matches the behavior that is expressed
even on glibc for some file descriptors (the waiting read will commonly
get error EINVAL there). We can't decide on the real cause of this
situation and thus we always report EIO error and thus generic
input/output error.

Signed-off-by: Karel Kočí <kkoci@elektroline.cz>
2025-11-05 20:45:05 +08:00
..