mirror of
https://git.musl-libc.org/git/musl
synced 2025-01-23 06:32:05 +03:00
fix sendmmsg emulation return value for zero-length vector
this case is not even documented, but the kernel returns 0 here and it makes sense to be consistent.
This commit is contained in:
parent
3fa2eb2aba
commit
2e5d256984
@ -12,6 +12,7 @@ int sendmmsg(int fd, struct mmsghdr *msgvec, unsigned int vlen, unsigned int fla
|
||||
* and the cmsg blocks cannot be modified in-place. */
|
||||
int i;
|
||||
if (vlen > IOV_MAX) vlen = IOV_MAX; /* This matches the kernel. */
|
||||
if (!vlen) return 0;
|
||||
for (i=0; i<vlen; i++) {
|
||||
/* As an unfortunate inconsistency, the sendmmsg API uses
|
||||
* unsigned int for the resulting msg_len, despite sendmsg
|
||||
|
Loading…
Reference in New Issue
Block a user