diff options
author | Damien Miller <djm@cvs.openbsd.org> | 2011-11-03 02:34:34 +0000 |
---|---|---|
committer | Damien Miller <djm@cvs.openbsd.org> | 2011-11-03 02:34:34 +0000 |
commit | 83e0d2b6dc9f5d1e1d9da1d5fb2b3e4a1b95ed29 (patch) | |
tree | b4be7ab0261dff4bf6e721d276b191619415c6e4 /lib/libcrypto/rand/randfile.c | |
parent | ce9ed2f66babb3442b71c8a7b580758c546d433a (diff) |
openssl-1.0.0e: resolve conflicts
Diffstat (limited to 'lib/libcrypto/rand/randfile.c')
-rw-r--r-- | lib/libcrypto/rand/randfile.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libcrypto/rand/randfile.c b/lib/libcrypto/rand/randfile.c index 4ed40b7b70a..bc7d9c58049 100644 --- a/lib/libcrypto/rand/randfile.c +++ b/lib/libcrypto/rand/randfile.c @@ -144,7 +144,9 @@ int RAND_load_file(const char *file, long bytes) * I/O because we will waste system entropy. */ bytes = (bytes == -1) ? 2048 : bytes; /* ok, is 2048 enough? */ +#ifndef OPENSSL_NO_SETVBUF_IONBF setvbuf(in, NULL, _IONBF, 0); /* don't do buffered reads */ +#endif /* ndef OPENSSL_NO_SETVBUF_IONBF */ } #endif for (;;) @@ -269,7 +271,6 @@ err: const char *RAND_file_name(char *buf, size_t size) { char *s=NULL; - int ok = 0; #ifdef __OpenBSD__ struct stat sb; #endif @@ -298,7 +299,6 @@ const char *RAND_file_name(char *buf, size_t size) BUF_strlcat(buf,"/",size); #endif BUF_strlcat(buf,RFILE,size); - ok = 1; } else buf[0] = '\0'; /* no file name */ @@ -312,7 +312,7 @@ const char *RAND_file_name(char *buf, size_t size) * to something hopefully decent if that isn't available. */ - if (!ok) + if (!buf[0]) if (BUF_strlcpy(buf,"/dev/arandom",size) >= size) { return(NULL); } |