summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgotoyuzo <gotoyuzo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-11-01 01:52:13 +0000
committergotoyuzo <gotoyuzo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-11-01 01:52:13 +0000
commit4798cd1bb3e7b38b0f56d71b88538a773a8c03ca (patch)
tree61fadfcf208ec07aa871ee247086ac7a446b804b
parent0107f4506b25a09973ab69aa6556586f77d1abd6 (diff)
* ext/openssl/extconf.rb: should check ERR_peek_last_error().
[ruby-dev:27597] * ext/openssl/ossl.c (ossl_raise): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9488 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog7
-rw-r--r--ext/openssl/extconf.rb1
-rw-r--r--ext/openssl/ossl.c7
3 files changed, 14 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 17f0d8c..3ec0b5d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Tue Nov 01 10:50:17 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+
+ * ext/openssl/extconf.rb: should check ERR_peek_last_error().
+ [ruby-dev:27597]
+
+ * ext/openssl/ossl.c (ossl_raise): ditto.
+
Mon Oct 31 17:34:46 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
* configure.in: use proper option for Sun linker. A patch from
diff --git a/ext/openssl/extconf.rb b/ext/openssl/extconf.rb
index 2ced7f6..f2fe9a4 100644
--- a/ext/openssl/extconf.rb
+++ b/ext/openssl/extconf.rb
@@ -62,6 +62,7 @@ unless have_header("openssl/conf_api.h")
end
message "=== Checking for OpenSSL features... ===\n"
+have_func("ERR_peek_last_error")
have_func("BN_mod_add")
have_func("BN_mod_sqr")
have_func("BN_mod_sub")
diff --git a/ext/openssl/ossl.c b/ext/openssl/ossl.c
index b7eb79f..a98f264 100644
--- a/ext/openssl/ossl.c
+++ b/ext/openssl/ossl.c
@@ -278,9 +278,14 @@ ossl_raise(VALUE exc, const char *fmt, ...)
va_list args;
char buf[BUFSIZ];
const char *msg;
- long e = ERR_peek_last_error();
+ long e;
int len = 0;
+#ifdef HAVE_ERR_PEEK_LAST_ERROR
+ e = ERR_peek_last_error();
+#else
+ e = ERR_peek_error();
+#endif
if (fmt) {
va_start(args, fmt);
len = vsnprintf(buf, BUFSIZ, fmt, args);