From 4f5713cc0abfd9a9971ce1cdfdc79ff104f75af3 Mon Sep 17 00:00:00 2001 From: David van Moolenbroek Date: Mon, 25 Jan 2016 19:03:59 +0100 Subject: [PATCH] tests: another fix - test80: resolve race condition resulting from unintended send Change-Id: Id029d679a3903de0f712a15d4756952dbc36070c --- minix/tests/common-socket.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/minix/tests/common-socket.c b/minix/tests/common-socket.c index 9300fa528..7de4f39ff 100644 --- a/minix/tests/common-socket.c +++ b/minix/tests/common-socket.c @@ -1637,12 +1637,12 @@ test_nonblock(const struct socket_test_info *info) test_fail("recv() should have yielded EAGAIN"); /* This may be an implementation aspect, or even plain wrong (?). */ - if (send(client_sd, buf, sizeof(buf), 0) != -1) { - if (!info->ignore_send_waiting) { + if (!info->ignore_send_waiting) { + if (send(client_sd, buf, sizeof(buf), 0) != -1) { test_fail("send() should have failed"); + } else if (errno != EAGAIN) { + test_fail("send() should have yielded EAGAIN"); } - } else if (errno != EAGAIN) { - test_fail("send() should have yielded EAGAIN"); } switch (fork()) { -- 2.44.0