summaryrefslogtreecommitdiff
path: root/ext/etc
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-19 08:45:25 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-19 08:45:25 +0000
commit350e6ed84b4ee661b2da255d298b9060991375ee (patch)
tree0f3dfef36765ff343762dd83da2d662710ddda71 /ext/etc
parentc3ab4a4b1bab1dd8276c97306195361021822357 (diff)
* ext/etc/etc.c (Init_etc): define constant aliases Etc::Passwd
and Etc::Group. [ruby-dev:35150] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17428 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/etc')
-rw-r--r--ext/etc/etc.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/ext/etc/etc.c b/ext/etc/etc.c
index 6cff5ba..f09c8d7 100644
--- a/ext/etc/etc.c
+++ b/ext/etc/etc.c
@@ -482,8 +482,6 @@ etc_getgrent(VALUE obj)
return Qnil;
}
-static VALUE mEtc;
-
/* The etc module provides access to information from the /etc/passwd and
* /etc/group files on Linux and Unix systems.
*
@@ -492,8 +490,9 @@ static VALUE mEtc;
void
Init_etc(void)
{
- mEtc = rb_define_module("Etc");
+ VALUE mEtc;
+ mEtc = rb_define_module("Etc");
rb_define_module_function(mEtc, "getlogin", etc_getlogin, 0);
rb_define_module_function(mEtc, "getpwuid", etc_getpwuid, -1);
@@ -535,8 +534,7 @@ Init_etc(void)
"expire",
#endif
NULL);
-
- rb_register_mark_object(sPasswd);
+ rb_define_const(mEtc, "Passwd", sPasswd);
#ifdef HAVE_GETGRENT
sGroup = rb_struct_define("Group", "name",
@@ -545,6 +543,6 @@ Init_etc(void)
#endif
"gid", "mem", NULL);
- rb_register_mark_object(sGroup);
+ rb_define_const(mEtc, "Group", sGroup);
#endif
}