ruby-changes:14564
From: nobu <ko1@a...>
Date: Mon, 25 Jan 2010 18:49:13 +0900 (JST)
Subject: [ruby-changes:14564] Ruby:r26404 (trunk): * file.c (be_chown, be_fchown, eaccess): suppressed warnings.
nobu 2010-01-25 18:47:11 +0900 (Mon, 25 Jan 2010) New Revision: 26404 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=26404 Log: * file.c (be_chown, be_fchown, eaccess): suppressed warnings. Modified files: trunk/file.c Index: file.c =================================================================== --- file.c (revision 26403) +++ file.c (revision 26404) @@ -74,11 +74,11 @@ static int be_chown(const char *path, uid_t owner, gid_t group) { - if (owner == -1 || group == -1) { + if (owner == (uid_t)-1 || group == (gid_t)-1) { struct stat st; if (stat(path, &st) < 0) return -1; - if (owner == -1) owner = st.st_uid; - if (group == -1) group = st.st_gid; + if (owner == (uid_t)-1) owner = st.st_uid; + if (group == (gid_t)-1) group = st.st_gid; } return chown(path, owner, group); } @@ -86,11 +86,11 @@ static int be_fchown(int fd, uid_t owner, gid_t group) { - if (owner == -1 || group == -1) { + if (owner == (uid_t)-1 || group == (gid_t)-1) { struct stat st; if (fstat(fd, &st) < 0) return -1; - if (owner == -1) owner = st.st_uid; - if (group == -1) group = st.st_gid; + if (owner == (uid_t)-1) owner = st.st_uid; + if (group == (gid_t)-1) group = st.st_gid; } return fchown(fd, owner, group); } @@ -990,7 +990,7 @@ else if (group_member(st.st_gid)) mode <<= 3; - if ((st.st_mode & mode) == mode) return 0; + if ((int)(st.st_mode & mode) == mode) return 0; return -1; #else -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/