aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-07-20 06:50:54 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-07-20 06:50:54 +0000
commit13f62a384b48a5e8ade2319e102a6aa31a0321c9 (patch)
tree8d5a7fd5a54b12cb0fb582f01579719a7294a770
parent7e0907ceddbd939ea3d04c9630ad509ade7a4d60 (diff)
downloadruby-13f62a384b48a5e8ade2319e102a6aa31a0321c9.tar.gz
* ext/dl/handle.c (dlhandle_sym): clear previous error with dlerror()
before calling dlsym(). [ruby-dev:44091] [Bug #5021] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32586 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--ext/dl/handle.c3
2 files changed, 8 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 2ab25bfc73..5c84d9aa3e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Wed Jul 20 15:16:22 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/dl/handle.c (dlhandle_sym): clear previous error with dlerror()
+ before calling dlsym(). [ruby-dev:44091] [Bug #5021]
+
Wed Jul 20 07:16:26 2011 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
* NEWS: mention Kernel#warn. [ruby-core:38119] [Feature #5029]
diff --git a/ext/dl/handle.c b/ext/dl/handle.c
index ce04acbe21..eea8697e06 100644
--- a/ext/dl/handle.c
+++ b/ext/dl/handle.c
@@ -305,6 +305,9 @@ dlhandle_sym(void *handle, const char *name)
void (*func)();
rb_secure(2);
+#ifdef HAVE_DLERROR
+ dlerror();
+#endif
func = (void (*)())(VALUE)dlsym(handle, name);
CHECK_DLERROR;
#if defined(FUNC_STDCALL)