summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--load.c3
2 files changed, 7 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 94f7c0b..cf2efda 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Sun Mar 2 10:47:58 2014 Eric Wong <e@80x24.org>
+
+ * load.c (ruby_init_ext): make idempotent to suppress warnings
+
Sat Mar 1 19:51:42 2014 Tanaka Akira <akr@fsij.org>
* lib/open3.rb (Open3.capture3): Ignore Errno::EPIPE for writing
diff --git a/load.c b/load.c
index 811d035..e88abfb 100644
--- a/load.c
+++ b/load.c
@@ -1059,10 +1059,13 @@ ruby_init_ext(const char *name, void (*init)(void))
{
st_table *loading_tbl = get_loading_table();
+ if (rb_provided(name))
+ return;
if (!loading_tbl) {
GET_VM()->loading_table = loading_tbl = st_init_strtable();
}
st_update(loading_tbl, (st_data_t)name, register_init_ext, (st_data_t)init);
+ rb_provide(name);
}
/*