projects
/
oweals
/
musl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3fa2eb2
)
fix sendmmsg emulation return value for zero-length vector
author
Rich Felker
<dalias@aerifal.cx>
Fri, 20 Jun 2014 06:13:38 +0000
(
02:13
-0400)
committer
Rich Felker
<dalias@aerifal.cx>
Fri, 20 Jun 2014 06:13:38 +0000
(
02:13
-0400)
this case is not even documented, but the kernel returns 0 here and it
makes sense to be consistent.
src/network/sendmmsg.c
patch
|
blob
|
history
diff --git
a/src/network/sendmmsg.c
b/src/network/sendmmsg.c
index ff9f86187238d71df0321460c186cd36f1797934..eeae1d0a5822503f5c572a46e3d3696f6c95b1b9 100644
(file)
--- a/
src/network/sendmmsg.c
+++ b/
src/network/sendmmsg.c
@@
-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