summaryrefslogtreecommitdiff
path: root/ext/etc/etc.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/etc/etc.c')
-rw-r--r--ext/etc/etc.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/ext/etc/etc.c b/ext/etc/etc.c
index f09c8d7..cb850f6 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;