aboutsummaryrefslogtreecommitdiff
path: root/src/util/test_bio.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2009-11-20 21:25:51 +0000
committerChristian Grothoff <christian@grothoff.org>2009-11-20 21:25:51 +0000
commite93e15fae30dc34dd7c53779c12261df6d1897de (patch)
treefdcc5eba69e2a909850878d123b1b0be61ae7775 /src/util/test_bio.c
parente1c3a58957ae32dbb14eb9eef8d45aab79dc22b4 (diff)
downloadgnunet-e93e15fae30dc34dd7c53779c12261df6d1897de.tar.gz
gnunet-e93e15fae30dc34dd7c53779c12261df6d1897de.zip
existing code does not work on freebsd because there reading directory files directly is fine, also fixing buffer size issues
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 dfd51297e..87617ddda 100644
--- a/src/util/test_bio.c
+++ b/src/util/test_bio.c
@@ -202,6 +202,7 @@ test_bigmeta_rw ()
202static int 202static int
203test_directory_r () 203test_directory_r ()
204{ 204{
205#if LINUX
205 char *msg; 206 char *msg;
206 char readResult[200]; 207 char readResult[200];
207 struct GNUNET_BIO_ReadHandle *fileR; 208 struct GNUNET_BIO_ReadHandle *fileR;
@@ -209,10 +210,11 @@ test_directory_r ()
209 fileR = GNUNET_BIO_read_open ("/dev"); 210 fileR = GNUNET_BIO_read_open ("/dev");
210 GNUNET_assert (NULL != fileR); 211 GNUNET_assert (NULL != fileR);
211 GNUNET_assert (GNUNET_SYSERR == 212 GNUNET_assert (GNUNET_SYSERR ==
212 GNUNET_BIO_read (fileR, "Read error", readResult, 65537)); 213 GNUNET_BIO_read (fileR, "Read error", readResult, sizeof(readResult)));
213 msg = NULL; 214 msg = NULL;
214 GNUNET_BIO_read_close (fileR, &msg); 215 GNUNET_BIO_read_close (fileR, &msg);
215 GNUNET_free (msg); 216 GNUNET_free (msg);
217#endif
216 return 0; 218 return 0;
217} 219}
218 220
@@ -264,7 +266,7 @@ test_nullfile_rw ()
264 fileR = GNUNET_BIO_read_open ("/dev/null"); 266 fileR = GNUNET_BIO_read_open ("/dev/null");
265 GNUNET_assert (NULL != fileR); 267 GNUNET_assert (NULL != fileR);
266 GNUNET_assert (GNUNET_SYSERR == 268 GNUNET_assert (GNUNET_SYSERR ==
267 GNUNET_BIO_read (fileR, "Read error", readResult, 65537)); 269 GNUNET_BIO_read (fileR, "Read error", readResult, sizeof(readResult)));
268 readResultString = NULL; 270 readResultString = NULL;
269 GNUNET_assert (GNUNET_SYSERR == 271 GNUNET_assert (GNUNET_SYSERR ==
270 GNUNET_BIO_read_string (fileR, "Read string error", 272 GNUNET_BIO_read_string (fileR, "Read string error",