1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-11-04 20:38:50 +01:00

* cipher.c (fast_random_poll): Only use times() if we HAVE_TIMES.

This commit is contained in:
David Shaw 2003-05-08 21:53:32 +00:00
parent 7ee7c76121
commit f20f778c85
2 changed files with 11 additions and 5 deletions

View File

@ -1,3 +1,7 @@
2003-05-08 David Shaw <dshaw@jabberwocky.com>
* cipher.c (fast_random_poll): Only use times() if we HAVE_TIMES.
2003-04-15 Werner Koch <wk@gnupg.org> 2003-04-15 Werner Koch <wk@gnupg.org>
* md.c (md_start_debug): Need to open the file in binary mode. * md.c (md_start_debug): Need to open the file in binary mode.

View File

@ -38,12 +38,15 @@
#include <sys/stat.h> #include <sys/stat.h>
#include <unistd.h> #include <unistd.h>
#include <fcntl.h> #include <fcntl.h>
#ifdef HAVE_GETHRTIME #ifdef HAVE_GETHRTIME
#include <sys/times.h> #include <sys/times.h>
#endif #endif
#ifdef HAVE_GETTIMEOFDAY #ifdef HAVE_GETTIMEOFDAY
#include <sys/times.h> #include <sys/times.h>
#endif #endif
#ifdef HAVE_TIMES
#include <sys/times.h>
#endif
#ifdef HAVE_GETRUSAGE #ifdef HAVE_GETRUSAGE
#include <sys/resource.h> #include <sys/resource.h>
#endif #endif
@ -650,13 +653,12 @@ fast_random_poll()
add_randomness( &tv.tv_sec, sizeof(tv.tv_sec), 1 ); add_randomness( &tv.tv_sec, sizeof(tv.tv_sec), 1 );
add_randomness( &tv.tv_nsec, sizeof(tv.tv_nsec), 1 ); add_randomness( &tv.tv_nsec, sizeof(tv.tv_nsec), 1 );
} }
#else /* use times */ #elif defined (HAVE_TIMES)
#ifndef HAVE_DOSISH_SYSTEM
{ struct tms buf; { struct tms buf;
times( &buf ); if( times( &buf ) == -1 )
BUG();
add_randomness( &buf, sizeof buf, 1 ); add_randomness( &buf, sizeof buf, 1 );
} }
#endif
#endif #endif
#ifdef HAVE_GETRUSAGE #ifdef HAVE_GETRUSAGE
#ifndef RUSAGE_SELF #ifndef RUSAGE_SELF