aboutsummaryrefslogtreecommitdiffstats
path: root/process.c
diff options
context:
space:
mode:
author卜部昌平 <shyouhei@ruby-lang.org>2019-08-27 11:16:52 +0900
committer卜部昌平 <shyouhei@ruby-lang.org>2019-08-27 15:52:26 +0900
commitae2dc3f217ba9f181471f39a7e5ce72a28b27c2a (patch)
treee506115b9dd5c2adb07946763506a5b46d36b5f0 /process.c
parent78628618da98236fc1bf702079185b36ed394e2a (diff)
downloadruby-ae2dc3f217ba9f181471f39a7e5ce72a28b27c2a.tar.gz
rb_define_hooked_variable now free from ANYARGS
After 5e86b005c0f2ef30df2f9906c7e2f3abefe286a2, I now think ANYARGS is dangerous and should be extinct. This commit uses rb_gvar_getter_t / rb_gvar_setter_t for rb_define_hooked_variable / rb_define_virtual_variable which revealed lots of function prototype inconsistencies. Some of them were literally decades old, going back to dda5dc00cff334cac373096d444a0fd59e716124.
Diffstat (limited to 'process.c')
-rw-r--r--process.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/process.c b/process.c
index 8cd42db802..dad090712c 100644
--- a/process.c
+++ b/process.c
@@ -8038,6 +8038,18 @@ rb_clock_getres(int argc, VALUE *argv)
}
}
+static VALUE
+get_$CHILD_STATUS(ID _x, VALUE *_y)
+{
+ return rb_last_status_get();
+}
+
+static VALUE
+get_$PROCESS_ID(ID _x, VALUE *_y)
+{
+ return get_pid();
+}
+
VALUE rb_mProcess;
static VALUE rb_mProcUID;
static VALUE rb_mProcGID;
@@ -8054,8 +8066,8 @@ InitVM_process(void)
{
#undef rb_intern
#define rb_intern(str) rb_intern_const(str)
- rb_define_virtual_variable("$?", rb_last_status_get, 0);
- rb_define_virtual_variable("$$", get_pid, 0);
+ rb_define_virtual_variable("$?", get_$CHILD_STATUS, 0);
+ rb_define_virtual_variable("$$", get_$PROCESS_ID, 0);
rb_define_global_function("exec", rb_f_exec, -1);
rb_define_global_function("fork", rb_f_fork, 0);
rb_define_global_function("exit!", rb_f_exit_bang, -1);