summaryrefslogtreecommitdiff
path: root/process.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-04-03 09:33:40 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-04-03 09:33:40 +0000
commitca512bdaa878df34fd27b720998d40fbc68a5e0f (patch)
treec335d98f21af875552a003a2f1b759bc53d97e8c /process.c
parent31bd33a6624768c7c14d0681b3c1908f3c988307 (diff)
downloadruby-ca512bdaa878df34fd27b720998d40fbc68a5e0f.tar.gz
* process.c (setreuid, setregid): suppress warnings.
[ruby-core:43374][Bug #6169] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35221 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'process.c')
-rw-r--r--process.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/process.c b/process.c
index 3c67bb6396..390cbdb047 100644
--- a/process.c
+++ b/process.c
@@ -113,9 +113,11 @@ static VALUE rb_cProcessTms;
#ifdef BROKEN_SETREUID
#define setreuid ruby_setreuid
+int setreuid(rb_uid_t ruid, rb_uid_t euid);
#endif
#ifdef BROKEN_SETREGID
#define setregid ruby_setregid
+int setregid(rb_gid_t rgid, rb_gid_t egid);
#endif
#if defined(HAVE_44BSD_SETUID) || defined(__MacOS_X__)
@@ -4307,11 +4309,11 @@ static rb_uid_t SAVED_USER_ID = -1;
int
setreuid(rb_uid_t ruid, rb_uid_t euid)
{
- if (ruid != -1 && ruid != getuid()) {
- if (euid == -1) euid = geteuid();
+ if (ruid != (rb_uid_t)-1 && ruid != getuid()) {
+ if (euid == (rb_uid_t)-1) euid = geteuid();
if (setuid(ruid) < 0) return -1;
}
- if (euid != -1 && euid != geteuid()) {
+ if (euid != (rb_uid_t)-1 && euid != geteuid()) {
if (seteuid(euid) < 0) return -1;
}
return 0;
@@ -5010,11 +5012,11 @@ static rb_gid_t SAVED_GROUP_ID = -1;
int
setregid(rb_gid_t rgid, rb_gid_t egid)
{
- if (rgid != -1 && rgid != getgid()) {
- if (egid == -1) egid = getegid();
+ if (rgid != (rb_gid_t)-1 && rgid != getgid()) {
+ if (egid == (rb_gid_t)-1) egid = getegid();
if (setgid(rgid) < 0) return -1;
}
- if (egid != -1 && egid != getegid()) {
+ if (egid != (rb_gid_t)-1 && egid != getegid()) {
if (setegid(egid) < 0) return -1;
}
return 0;