From: Christian Grothoff Date: Fri, 20 Nov 2009 21:25:51 +0000 (+0000) Subject: existing code does not work on freebsd because there reading directory files directly... X-Git-Tag: initial-import-from-subversion-38251~23045 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=e93e15fae30dc34dd7c53779c12261df6d1897de;p=oweals%2Fgnunet.git existing code does not work on freebsd because there reading directory files directly is fine, also fixing buffer size issues --- 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 () 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",