@@ -1158,8 +1158,7 @@ Init_etc(void)
1158
1158
#endif
1159
1159
NULL );
1160
1160
#if 0
1161
- /* Define-const: Passwd
1162
- *
1161
+ /*
1163
1162
* Passwd is a Struct that contains the following members:
1164
1163
*
1165
1164
* name::
@@ -1197,12 +1196,13 @@ Init_etc(void)
1197
1196
* expire::
1198
1197
* account expiration time(integer) must be compiled with +HAVE_STRUCT_PASSWD_PW_EXPIRE+
1199
1198
*/
1200
- rb_define_const (mEtc , "Passwd" , sPasswd );
1199
+ sPasswd = rb_define_class_under (mEtc , "Passwd" , rb_cStruct );
1201
1200
#endif
1202
1201
rb_define_const (rb_cStruct , "Passwd" , sPasswd ); /* deprecated name */
1203
1202
rb_deprecate_constant (rb_cStruct , "Passwd" );
1204
1203
rb_extend_object (sPasswd , rb_mEnumerable );
1205
1204
rb_define_singleton_method (sPasswd , "each" , etc_each_passwd , 0 );
1205
+
1206
1206
#ifdef HAVE_GETGRENT
1207
1207
sGroup = rb_struct_define_under (mEtc , "Group" , "name" ,
1208
1208
#ifdef HAVE_STRUCT_GROUP_GR_PASSWD
@@ -1211,8 +1211,7 @@ Init_etc(void)
1211
1211
"gid" , "mem" , NULL );
1212
1212
1213
1213
#if 0
1214
- /* Define-const: Group
1215
- *
1214
+ /*
1216
1215
* Group is a Struct that is only available when compiled with +HAVE_GETGRENT+.
1217
1216
*
1218
1217
* The struct contains the following members:
@@ -1232,7 +1231,7 @@ Init_etc(void)
1232
1231
* is an Array of Strings containing the short login names of the
1233
1232
* members of the group.
1234
1233
*/
1235
- rb_define_const (mEtc , "Group" , sGroup );
1234
+ sGroup = rb_define_class_under (mEtc , "Group" , rb_cStruct );
1236
1235
#endif
1237
1236
rb_define_const (rb_cStruct , "Group" , sGroup ); /* deprecated name */
1238
1237
rb_deprecate_constant (rb_cStruct , "Group" );
0 commit comments