Commit 2511d119 authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

* seed_enough() was converted to a macro to avoid the IRIX compiler warning

about that passed-in argument not being used.
* killed trailing whitespace
parent e9056f5f
Loading
Loading
Loading
Loading
+65 −60
Original line number Diff line number Diff line
@@ -104,22 +104,27 @@ static int passwd_callback(char *buf, int num, int verify
  return 0;
}

static
bool seed_enough(int nread)
{
#ifdef HAVE_RAND_STATUS
  nread = 0; /* to prevent compiler warnings */
/*
 * rand_enough() is a function that returns TRUE if we have seeded the random
 * engine properly. We use some preprocessor magic to provide a seed_enough()
 * macro to use, just to prevent a compiler warning on this function if we
 * pass in an argument that is never used.
 */

  /* only available in OpenSSL 0.9.5a and later */
  if(RAND_status())
    return TRUE;
#ifdef HAVE_RAND_STATUS
#define seed_enough(x) rand_enough()
static bool rand_enough(void)
{
  return RAND_status()?TRUE:FALSE;
}
#else
  if(nread > 500)
#define seed_enough(x) rand_enough(x)
static bool rand_enough(int nread)
{
  /* this is a very silly decision to make */
    return TRUE;
#endif
  return FALSE; /* not enough */
  return (nread > 500)?TRUE:FALSE;
}
#endif

static
int random_the_seed(struct SessionHandle *data)