summaryrefslogtreecommitdiff
path: root/ext/etc/etc.c
diff options
context:
space:
mode:
authorcharliesome <charliesome@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-22 05:43:08 +0000
committercharliesome <charliesome@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-22 05:43:08 +0000
commit3f236ce7ba7bce9a92df2989914fed9957bc89de (patch)
treea6c86233aec38b8bcfd9328d685b65c4aced87b3 /ext/etc/etc.c
parent4b4ba84eb8e3b2a9efd1b2ea1ae6ee4869a9100c (diff)
* ext/etc/etc.c (Init_etc): omit 'passwd' from definition of Etc::Passwd
if HAVE_STRUCT_PASSWD_PW_PASSWD is not defined to prevent mismatch of fields and values in setup_passwd git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41562 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/etc/etc.c')
-rw-r--r--ext/etc/etc.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/ext/etc/etc.c b/ext/etc/etc.c
index 1c52535..7fbe2e9 100644
--- a/ext/etc/etc.c
+++ b/ext/etc/etc.c
@@ -673,11 +673,17 @@ Init_etc(void)
rb_define_module_function(mEtc, "systmpdir", etc_systmpdir, 0);
sPasswd = rb_struct_define(NULL,
- "name", "passwd", "uid", "gid",
+ "name",
+#ifdef HAVE_STRUCT_PASSWD_PW_PASSWD
+ "passwd",
+#endif
+ "uid",
+ "gid",
#ifdef HAVE_STRUCT_PASSWD_PW_GECOS
"gecos",
#endif
- "dir", "shell",
+ "dir",
+ "shell",
#ifdef HAVE_STRUCT_PASSWD_PW_CHANGE
"change",
#endif