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/trunk@19946 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2008-10-26 09:07:37 +00:00
parent 860fad971d
commit 201eb37d92
2 changed files with 9 additions and 4 deletions

View file

@ -1,4 +1,4 @@
Sun Oct 26 18:01:06 2008 Nobuyoshi Nakada <nobu@ruby-lang.org> Sun Oct 26 18:07:20 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* thread.c (blocking_region_{begin,end}): declared as inline. * thread.c (blocking_region_{begin,end}): declared as inline.
@ -6,6 +6,8 @@ Sun Oct 26 18:01:06 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* win32/win32.c (rb_w32_pipe): serial is DWORD. * win32/win32.c (rb_w32_pipe): serial is DWORD.
* ext/etc/etc.c (sGroup): getgrent may not be available.
Sun Oct 26 13:30:28 2008 Nobuyoshi Nakada <nobu@ruby-lang.org> Sun Oct 26 13:30:28 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* io.c (read_all): use the given buffer to read when needs readconv. * io.c (read_all): use the given buffer to read when needs readconv.

View file

@ -26,7 +26,10 @@
#define uid_t int #define uid_t int
#endif #endif
static VALUE sPasswd, sGroup; static VALUE sPasswd;
#ifdef HAVE_GETGRENT
static VALUE sGroup;
#endif
#ifndef _WIN32 #ifndef _WIN32
char *getenv(); char *getenv();
@ -132,7 +135,7 @@ etc_getpwuid(int argc, VALUE *argv, VALUE obj)
uid = getuid(); uid = getuid();
} }
pwd = getpwuid(uid); 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); return setup_passwd(pwd);
#else #else
return Qnil; return Qnil;
@ -333,7 +336,7 @@ etc_getgrgid(int argc, VALUE *argv, VALUE obj)
gid = getgid(); gid = getgid();
} }
grp = getgrgid(gid); 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); return setup_group(grp);
#else #else
return Qnil; return Qnil;