aboutsummaryrefslogtreecommitdiff
path: root/src/util/test_bio.c
diff options
context:
space:
mode:
authorgrothoff <grothoff@140774ce-b5e7-0310-ab8b-a85725594a96>2009-11-20 21:25:51 +0000
committergrothoff <grothoff@140774ce-b5e7-0310-ab8b-a85725594a96>2009-11-20 21:25:51 +0000
commit1ad49e5d592dfb9b40efa39048e92fd3adba6e01 (patch)
treefdcc5eba69e2a909850878d123b1b0be61ae7775 /src/util/test_bio.c
parenta6cad23abf43a996aa3bf64361ed3ab0932f7bee (diff)
existing code does not work on freebsd because there reading directory files directly is fine, also fixing buffer size issues
git-svn-id: https://gnunet.org/svn/gnunet@9597 140774ce-b5e7-0310-ab8b-a85725594a96
Diffstat (limited to 'src/util/test_bio.c')
-rw-r--r--src/util/test_bio.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/util/test_bio.c b/src/util/test_bio.c
index dfd51297e4..87617ddda4 100644
--- a/src/util/test_bio.c
+++ b/src/util/test_bio.c
@@ -202,6 +202,7 @@ test_bigmeta_rw ()
static int
test_directory_r ()
{
+#if LINUX
char *msg;
char readResult[200];
struct GNUNET_BIO_ReadHandle *fileR;
@@ -209,10 +210,11 @@ test_directory_r ()
fileR = GNUNET_BIO_read_open ("/dev");
GNUNET_assert (NULL != fileR);
GNUNET_assert (GNUNET_SYSERR ==
- GNUNET_BIO_read (fileR, "Read error", readResult, 65537));
+ GNUNET_BIO_read (fileR, "Read error", readResult, sizeof(readResult)));
msg = NULL;
GNUNET_BIO_read_close (fileR, &msg);
GNUNET_free (msg);
+#endif
return 0;
}
@@ -264,7 +266,7 @@ test_nullfile_rw ()
fileR = GNUNET_BIO_read_open ("/dev/null");
GNUNET_assert (NULL != fileR);
GNUNET_assert (GNUNET_SYSERR ==
- GNUNET_BIO_read (fileR, "Read error", readResult, 65537));
+ GNUNET_BIO_read (fileR, "Read error", readResult, sizeof(readResult)));
readResultString = NULL;
GNUNET_assert (GNUNET_SYSERR ==
GNUNET_BIO_read_string (fileR, "Read string error",