summaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
authorBill Stoddard <stoddard@apache.org>2000-07-31 19:51:22 +0000
committerBill Stoddard <stoddard@apache.org>2000-07-31 19:51:22 +0000
commita9c0f31d2e8d63cd54cdaab7744670f5bbcbee99 (patch)
tree90e0c68b04498c4920452b8280f607f3261ae123 /misc
parente1255c9302fbb2407f8fb994547cea243472a575 (diff)
downloadapr-a9c0f31d2e8d63cd54cdaab7744670f5bbcbee99.tar.gz
Win32: Return error codes on ap_generate_random()
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60461 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'misc')
-rw-r--r--misc/win32/rand.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/misc/win32/rand.c b/misc/win32/rand.c
index 1f6770e62..2c7abd595 100644
--- a/misc/win32/rand.c
+++ b/misc/win32/rand.c
@@ -61,18 +61,10 @@ ap_status_t ap_generate_random_bytes(unsigned char * buf, int length)
HCRYPTPROV hProv;
if (!CryptAcquireContext(&hProv,NULL,NULL,PROV_RSA_FULL,0)) {
- /* ap_log_error(APLOG_MARK, APLOG_CRIT, 0, s,
- "Digest: Error acquiring context. Errno = %d",
- GetLastError());
- exit(EXIT_FAILURE);*/
- return 1;
+ return GetLastError();
}
if (!CryptGenRandom(hProv,length,buf)) {
- /* ap_log_error(APLOG_MARK, APLOG_CRIT, 0, s,
- "Digest: Error generating secret. Errno = %d",
- GetLastError());
- exit(EXIT_FAILURE);*/
- return 1;
+ return GetLastError();
}
return APR_SUCCESS;
}