From 3a184fe9cc3973f4db9156badc9f40d421208719 Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Mon, 11 Jan 2016 00:17:13 +0000 Subject: [PATCH] mmsg.test: check decoding of flags passed to sendmmsg and recvmmsg * tests/mmsg.c (main): Pass MSG_DONTROUTE|MSG_NOSIGNAL to sendmmsg. Pass MSG_DONTWAIT to recvmmsg. * tests/mmsg.expected: Update. --- tests/mmsg.c | 4 ++-- tests/mmsg.expected | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/mmsg.c b/tests/mmsg.c index e3e84357..4dae0286 100644 --- a/tests/mmsg.c +++ b/tests/mmsg.c @@ -132,13 +132,13 @@ main(void) assert(dup2(sv[R], R) == R); assert(close(sv[R]) == 0); - int r = send_mmsg(W, mmh, n_mmh, 0); + int r = send_mmsg(W, mmh, n_mmh, MSG_DONTROUTE | MSG_NOSIGNAL); if (r < 0 && errno == ENOSYS) perror_msg_and_skip("sendmmsg"); assert((size_t)r == n_mmh); assert(close(W) == 0); - assert(recv_mmsg(R, mmh, n_mmh, 0, NULL) == n_mmh); + assert(recv_mmsg(R, mmh, n_mmh, MSG_DONTWAIT, NULL) == n_mmh); assert(close(R) == 0); return 0; diff --git a/tests/mmsg.expected b/tests/mmsg.expected index a170718c..708e029b 100644 --- a/tests/mmsg.expected +++ b/tests/mmsg.expected @@ -1,4 +1,4 @@ -sendmmsg(1, {{{msg_name(0)=NULL, msg_iov(2)=[{"one", 3}, {"two", 3}], msg_controllen=0, msg_flags=0}, 6}, {{msg_name(0)=NULL, msg_iov(1)=[{"three", 5}], msg_controllen=0, msg_flags=0}, 5}}, 2, 0) = 2 +sendmmsg(1, {{{msg_name(0)=NULL, msg_iov(2)=[{"one", 3}, {"two", 3}], msg_controllen=0, msg_flags=0}, 6}, {{msg_name(0)=NULL, msg_iov(1)=[{"three", 5}], msg_controllen=0, msg_flags=0}, 5}}, 2, MSG_DONTROUTE|MSG_NOSIGNAL) = 2 = 2 buffers in vector 0 * 3 bytes in buffer 0 | 00000 6f 6e 65 one | @@ -7,7 +7,7 @@ sendmmsg(1, {{{msg_name(0)=NULL, msg_iov(2)=[{"one", 3}, {"two", 3}], msg_contro = 1 buffers in vector 1 * 5 bytes in buffer 0 | 00000 74 68 72 65 65 three | -recvmmsg(0, {{{msg_name(0)=NULL, msg_iov(2)=[{"one", 3}, {"two", 3}], msg_controllen=0, msg_flags=0}, 6}, {{msg_name(0)=NULL, msg_iov(1)=[{"three", 5}], msg_controllen=0, msg_flags=0}, 5}}, 2, 0, NULL) = 2 (left NULL) +recvmmsg(0, {{{msg_name(0)=NULL, msg_iov(2)=[{"one", 3}, {"two", 3}], msg_controllen=0, msg_flags=0}, 6}, {{msg_name(0)=NULL, msg_iov(1)=[{"three", 5}], msg_controllen=0, msg_flags=0}, 5}}, 2, MSG_DONTWAIT, NULL) = 2 (left NULL) = 2 buffers in vector 0 * 3 bytes in buffer 0 | 00000 6f 6e 65 one | -- 2.40.0