aboutsummaryrefslogtreecommitdiffstats
path: root/cipher/rndlinux.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>1999-03-20 10:53:39 +0000
committerWerner Koch <[email protected]>1999-03-20 10:53:39 +0000
commitfb8dbdbd95ecad16676ae717df38e06e0a1e40ec (patch)
treee2cdda28c57d62deef9fb87981cc1b49f064a4c3 /cipher/rndlinux.c
parentSee ChangeLog: Wed Mar 17 13:09:03 CET 1999 Werner Koch (diff)
downloadgnupg-fb8dbdbd95ecad16676ae717df38e06e0a1e40ec.tar.gz
gnupg-fb8dbdbd95ecad16676ae717df38e06e0a1e40ec.zip
See ChangeLog: Sat Mar 20 11:53:40 CET 1999 Werner Koch
Diffstat (limited to '')
-rw-r--r--cipher/rndlinux.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/cipher/rndlinux.c b/cipher/rndlinux.c
index 365233bf6..8c591fbe8 100644
--- a/cipher/rndlinux.c
+++ b/cipher/rndlinux.c
@@ -48,14 +48,6 @@ static int open_device( const char *name, int minor );
static int gather_random( void (*add)(const void*, size_t, int), int requester,
size_t length, int level );
-#ifdef IS_MODULE
-static void tty_printf(const char *fmt, ... )
-{
- g10_log_info("tty_printf not available (%s)\n", fmt );
-}
-#endif
-
-
/****************
* Used to open the Linux and xBSD /dev/random devices
@@ -110,15 +102,24 @@ gather_random( void (*add)(const void*, size_t, int), int requester,
tv.tv_usec = 0;
if( !(rc=select(fd+1, &rfds, NULL, NULL, &tv)) ) {
if( !warn )
- tty_printf( _(
-"\n"
+ #ifdef IS_MODULE
+ fprintf(stderr,
+ #else
+ tty_printf(
+ #endif
+_("\n"
"Not enough random bytes available. Please do some other work to give\n"
"the OS a chance to collect more entropy! (Need %d more bytes)\n"), length );
warn = 1;
continue;
}
else if( rc == -1 ) {
- tty_printf("select() error: %s\n", strerror(errno));
+ #ifdef IS_MODULE
+ fprintf(stderr,
+ #else
+ tty_printf(
+ #endif
+ "select() error: %s\n", strerror(errno));
continue;
}