summaryrefslogtreecommitdiff
path: root/src/libstrongswan/tests/suites/test_watcher.c
diff options
context:
space:
mode:
authorYves-Alexis Perez <corsac@debian.org>2014-07-11 07:23:31 +0200
committerYves-Alexis Perez <corsac@debian.org>2014-07-11 07:23:31 +0200
commit81c63b0eed39432878f78727f60a1e7499645199 (patch)
tree82387d8fecd1c20788fd8bd784a9b0bde091fb6b /src/libstrongswan/tests/suites/test_watcher.c
parentc5ebfc7b9c16551fe825dc1d79c3f7e2f096f6c9 (diff)
downloadvyos-strongswan-81c63b0eed39432878f78727f60a1e7499645199.tar.gz
vyos-strongswan-81c63b0eed39432878f78727f60a1e7499645199.zip
Imported Upstream version 5.2.0
Diffstat (limited to 'src/libstrongswan/tests/suites/test_watcher.c')
-rw-r--r--src/libstrongswan/tests/suites/test_watcher.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/libstrongswan/tests/suites/test_watcher.c b/src/libstrongswan/tests/suites/test_watcher.c
index 9415bead9..11b4c3a7d 100644
--- a/src/libstrongswan/tests/suites/test_watcher.c
+++ b/src/libstrongswan/tests/suites/test_watcher.c
@@ -17,7 +17,6 @@
#include <library.h>
-#include <sched.h>
#include <unistd.h>
#include <errno.h>
@@ -48,7 +47,7 @@ START_TEST(test_read)
for (c = 'a'; c <= 'z'; c++)
{
- ck_assert_int_eq(write(fd[1], &c, 1), 1);
+ ck_assert_int_eq(send(fd[1], &c, 1, 0), 1);
while (testbuf[0] != c)
{
sched_yield();
@@ -84,7 +83,7 @@ START_TEST(test_write)
lib->watcher->add(lib->watcher, fd[1], WATCHER_WRITE, writecb, &in);
- ck_assert_int_eq(read(fd[0], &out, 1), 1);
+ ck_assert_int_eq(recv(fd[0], &out, 1, 0), 1);
ck_assert_int_eq(out, in);
lib->watcher->remove(lib->watcher, fd[1]);
@@ -123,7 +122,7 @@ START_TEST(test_multiread)
{
for (in = 'a'; in <= 'z'; in++)
{
- ck_assert_int_eq(write(fd[i][1], &in, 1), 1);
+ ck_assert_int_eq(send(fd[i][1], &in, 1, 0), 1);
while (out[i] != in)
{
sched_yield();
@@ -171,7 +170,7 @@ START_TEST(test_multiwrite)
{
for (i = 0; i < countof(fd); i++)
{
- ck_assert_int_eq(read(fd[i][0], &out, 1), 1);
+ ck_assert_int_eq(recv(fd[i][0], &out, 1, 0), 1);
ck_assert_int_eq(out, i);
}
}