Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/lib/libc/sys Handle ENOBUFS better and clean some whit...



details:   https://anonhg.NetBSD.org/src/rev/d875d4d83495
branches:  trunk
changeset: 445178:d875d4d83495
user:      roy <roy%NetBSD.org@localhost>
date:      Tue Oct 16 09:23:29 2018 +0000

description:
Handle ENOBUFS better and clean some whitespace.

diffstat:

 tests/lib/libc/sys/t_sendmmsg.c |  12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diffs (42 lines):

diff -r d49a846f822e -r d875d4d83495 tests/lib/libc/sys/t_sendmmsg.c
--- a/tests/lib/libc/sys/t_sendmmsg.c   Tue Oct 16 06:05:38 2018 +0000
+++ b/tests/lib/libc/sys/t_sendmmsg.c   Tue Oct 16 09:23:29 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: t_sendmmsg.c,v 1.1 2018/08/21 10:38:09 christos Exp $  */
+/*     $NetBSD: t_sendmmsg.c,v 1.2 2018/10/16 09:23:29 roy Exp $       */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: t_sendmmsg.c,v 1.1 2018/08/21 10:38:09 christos Exp $");
+__RCSID("$NetBSD: t_sendmmsg.c,v 1.2 2018/10/16 09:23:29 roy Exp $");
 
 #include <atf-c.h>
 #include <sys/types.h>
@@ -142,7 +142,7 @@
                        // XXX: ENOBUFS bug, on the receive side!!!
                        // in npkt = min(mmsgsize, mmsgcnt - n);
                        int npkt = min(3, mmsgcnt - n), a;
-                       do { 
+                       do {
                                a = 0;
                                ATF_REQUIRE(ioctl(fd[1], FIONSPACE, &a) != -1);
                                printf("1 %d\n", a);
@@ -184,11 +184,11 @@
                                if (rdied)
                                        break;
                                cnt = recv(fd[0], rgram, sizeof(rgram), 0);
-                               ATF_REQUIRE_MSG(cnt != -1, "recv failed (%s)",
-                                   strerror(errno));
+                               ATF_REQUIRE_MSG(cnt != -1 || errno != ENOBUFS,
+                                   "recv failed (%s)", strerror(errno));
                                ATF_CHECK_EQ_MSG(cnt, sizeof(rgram),
                                    "packet length");
-                               ATF_CHECK_EQ_MSG(rgram[0], n, 
+                               ATF_CHECK_EQ_MSG(rgram[0], n,
                                    "number %u != %u", rgram[0], n);
                                ATF_REQUIRE_MSG(memcmp(rgram + 1, DGRAM + 1,
                                    sizeof(rgram) - 1) == 0, "bad data");



Home | Main Index | Thread Index | Old Index