Commit e8c53d0d authored by Philippe Gerum's avatar Philippe Gerum Committed by Jan Kiszka

drivers/serial: always propagate -EINTR downstream

No ifs, not buts: drivers must pass -EINTR to the core whenever
received from a blocking call.

NOTE: this change also prevents userland from receiving a partial byte
count from an interrupted read/write operation, although such amount
of bytes may have been transferred from/to the corresponding software
FIFO.
Signed-off-by: Philippe Gerum's avatarPhilippe Gerum <rpm@xenomai.org>
Signed-off-by: Jan Kiszka's avatarJan Kiszka <jan.kiszka@siemens.com>
parent dcba8ed4
......@@ -1352,7 +1352,7 @@ break_unlocked:
clear_bit(0, &ctx->in_lock);
if ((read > 0) && ((ret == 0) || (ret == -EAGAIN) ||
(ret == -ETIMEDOUT) || (ret == -EINTR)))
(ret == -ETIMEDOUT)))
ret = read;
return ret;
......@@ -1471,7 +1471,7 @@ static ssize_t rt_imx_uart_write(struct rtdm_fd *fd, const void *buf,
rtdm_mutex_unlock(&ctx->out_lock);
if ((written > 0) && ((ret == 0) || (ret == -EAGAIN) ||
(ret == -ETIMEDOUT) || (ret == -EINTR)))
(ret == -ETIMEDOUT)))
ret = written;
return ret;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment