Mercurial > dropbear
diff fuzz-wrapfd.c @ 1739:13d834efc376 fuzz
merge from main
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Thu, 15 Oct 2020 19:55:15 +0800 |
parents | 60fceff95858 |
children | dfbe947bdf0d |
line wrap: on
line diff
--- a/fuzz-wrapfd.c Wed Feb 28 22:11:39 2018 +0800 +++ b/fuzz-wrapfd.c Thu Oct 15 19:55:15 2020 +0800 @@ -2,16 +2,18 @@ #include "includes.h" #include "fuzz-wrapfd.h" +#include "dbutil.h" + #include "fuzz.h" #define IOWRAP_MAXFD (FD_SETSIZE-1) static const int MAX_RANDOM_IN = 50000; -static const double CHANCE_CLOSE = 1.0 / 300; -static const double CHANCE_INTR = 1.0 / 200; -static const double CHANCE_READ1 = 0.6; -static const double CHANCE_READ2 = 0.3; -static const double CHANCE_WRITE1 = 0.8; -static const double CHANCE_WRITE2 = 0.3; +static const double CHANCE_CLOSE = 1.0 / 600; +static const double CHANCE_INTR = 1.0 / 900; +static const double CHANCE_READ1 = 0.96; +static const double CHANCE_READ2 = 0.5; +static const double CHANCE_WRITE1 = 0.96; +static const double CHANCE_WRITE2 = 0.5; struct fdwrap { enum wrapfd_mode mode; @@ -26,7 +28,7 @@ static unsigned int nused; static unsigned short rand_state[3]; -void wrapfd_setup() { +void wrapfd_setup(void) { TRACE(("wrapfd_setup")) nused = 0; memset(wrap_fds, 0x0, sizeof(wrap_fds)); @@ -195,7 +197,7 @@ nset++; } } - FD_ZERO(readfds); + DROPBEAR_FD_ZERO(readfds); if (nset > 0) { /* set one */ @@ -222,7 +224,7 @@ nset++; } } - FD_ZERO(writefds); + DROPBEAR_FD_ZERO(writefds); /* set one */ if (nset > 0) {