summaryrefslogtreecommitdiffstats
path: root/ext
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-02-19 06:14:27 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-02-19 06:14:27 +0000
commite276982e82549ad8ed8674ff2d2bf42f94f9008f (patch)
tree2f8f436a4e937d5d29bf927525acd574262e319b /ext
parentd3566c93796b99da181eaea7859cbd573c1d1f8e (diff)
downloadruby-e276982e82549ad8ed8674ff2d2bf42f94f9008f.tar.gz
ruby-e276982e82549ad8ed8674ff2d2bf42f94f9008f.tar.xz
ruby-e276982e82549ad8ed8674ff2d2bf42f94f9008f.zip
* ext/etc/etc.c (etc_each_group): defines only when Etc::Group is
available. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22438 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r--ext/etc/etc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/etc/etc.c b/ext/etc/etc.c
index d0d28c0d7..070560646 100644
--- a/ext/etc/etc.c
+++ b/ext/etc/etc.c
@@ -468,6 +468,7 @@ etc_group(VALUE obj)
return Qnil;
}
+#ifdef HAVE_GETPWENT
/* Iterates for each entry in the /etc/group file if a block is given.
* If no block is given, returns the enumerator.
*
@@ -489,12 +490,11 @@ etc_group(VALUE obj)
static VALUE
etc_each_group(VALUE obj)
{
-#ifdef HAVE_GETPWENT
RETURN_ENUMERATOR(obj, 0, 0);
each_group();
-#endif
return obj;
}
+#endif
/* Resets the process of reading the /etc/group file, so that the next call
* to getgrent will return the first entry again.