linux(4): Improve readability of recvmsg control buffer copyout code

MFC after:	1 week
This commit is contained in:
Dmitry Chagin 2023-08-14 15:46:12 +03:00
parent 43c3beb741
commit a21238d843

View File

@ -1866,10 +1866,9 @@ linux_recvmsg_common(struct thread *td, l_int s, struct l_msghdr *msghdr,
lcm->cmsg_len = LINUX_CMSG_LEN(datalen);
error = copyout(lcm, outbuf, L_CMSG_HDRSZ);
if (error == 0) {
outbuf += L_CMSG_HDRSZ;
error = copyout(data, outbuf, datalen);
error = copyout(data, LINUX_CMSG_DATA(outbuf), datalen);
if (error == 0) {
outbuf += LINUX_CMSG_ALIGN(datalen);
outbuf += LINUX_CMSG_SPACE(datalen);
outlen += LINUX_CMSG_SPACE(datalen);
}
}