Commit ccee5cfe authored by Jan Kiszka's avatar Jan Kiszka

rtdm: Do not return an error from send/recvmmsg if there are packets

This is in line with Linux behavior.

We likely still miss an equivalent to sk_err in recvmmsg, though.
Reported-by: default avatarLange Norbert <norbert.lange@andritz.com>
Signed-off-by: Jan Kiszka's avatarJan Kiszka <jan.kiszka@siemens.com>
parent efe0c947
......@@ -734,14 +734,12 @@ int __rtdm_fd_recvmmsg(int ufd, void __user *u_msgvec, unsigned int vlen,
xnlock_put_irqrestore(&nklock, s);
}
if (datagrams > 0 &&
(ret == 0 || ret == -ETIMEDOUT || ret == -EWOULDBLOCK)) {
/* NOTE: SO_ERROR should be honored for other errors. */
rtdm_fd_put(fd);
return datagrams;
}
fail:
rtdm_fd_put(fd);
if (datagrams > 0)
ret = datagrams;
out:
trace_cobalt_fd_recvmmsg_status(current, fd, ufd, ret);
......@@ -826,13 +824,11 @@ int __rtdm_fd_sendmmsg(int ufd, void __user *u_msgvec, unsigned int vlen,
datagrams++;
}
if (datagrams > 0 && (ret == 0 || ret == -EWOULDBLOCK)) {
/* NOTE: SO_ERROR should be honored for other errors. */
rtdm_fd_put(fd);
return datagrams;
}
rtdm_fd_put(fd);
if (datagrams > 0)
ret = datagrams;
out:
trace_cobalt_fd_sendmmsg_status(current, fd, ufd, 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