diff --git a/ChangeLog b/ChangeLog index 1f102ef180..486f3faae2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,4 @@ -Sun Oct 26 18:01:06 2008 Nobuyoshi Nakada +Sun Oct 26 18:07:20 2008 Nobuyoshi Nakada * thread.c (blocking_region_{begin,end}): declared as inline. @@ -6,6 +6,8 @@ Sun Oct 26 18:01:06 2008 Nobuyoshi Nakada * 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 * io.c (read_all): use the given buffer to read when needs readconv. diff --git a/ext/etc/etc.c b/ext/etc/etc.c index f09c8d76db..cb850f6987 100644 --- a/ext/etc/etc.c +++ b/ext/etc/etc.c @@ -26,7 +26,10 @@ #define uid_t int #endif -static VALUE sPasswd, sGroup; +static VALUE sPasswd; +#ifdef HAVE_GETGRENT +static VALUE sGroup; +#endif #ifndef _WIN32 char *getenv(); @@ -132,7 +135,7 @@ etc_getpwuid(int argc, VALUE *argv, VALUE 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; @@ -333,7 +336,7 @@ etc_getgrgid(int argc, VALUE *argv, VALUE obj) gid = getgid(); } 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;