1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* ext/etc/etc.c (sGroup): getgrent may not be available.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@22381 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2009-02-17 16:58:12 +00:00
parent 682f161d63
commit 9bc9c63d27
2 changed files with 10 additions and 3 deletions

View file

@ -1,3 +1,7 @@
Wed Feb 18 01:58:11 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/etc/etc.c (sGroup): getgrent may not be available.
Tue Feb 17 17:02:45 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* version.c, version.h: NO_STRING_LITERAL_CONCATENATION support.

View file

@ -27,7 +27,10 @@
#define uid_t int
#endif
static VALUE sPasswd, sGroup;
static VALUE sPasswd;
#ifdef HAVE_GETGRENT
static VALUE sGroup;
#endif
#ifndef _WIN32
char *getenv();
@ -139,7 +142,7 @@ etc_getpwuid(argc, argv, obj)
uid = getuid();
}
pwd = getpwuid(uid);
if (pwd == 0) rb_raise(rb_eArgError, "can't find user for %d", uid);
if (pwd == 0) rb_raise(rb_eArgError, "can't find user for %d", (int)uid);
return setup_passwd(pwd);
#else
return Qnil;
@ -341,7 +344,7 @@ etc_getgrgid(obj, id)
rb_secure(4);
gid = PW_VAL2GID(id);
grp = getgrgid(gid);
if (grp == 0) rb_raise(rb_eArgError, "can't find group for %d", gid);
if (grp == 0) rb_raise(rb_eArgError, "can't find group for %d", (int)gid);
return setup_group(grp);
#else
return Qnil;