summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-03-02 12:27:33 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-03-02 12:27:33 +0000
commit8a00868c3dc6981c300cc62020767bda5bb4b2a0 (patch)
tree11fc3784ac7857b6c465a1de476d905c74e72d31
parentfb5d4ecfb5d03aa9f6116b53dbcb1b72bbba3c95 (diff)
* ext/socket/ancdata.c (anc_inspect_socket_creds): supress warnings.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22711 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog4
-rw-r--r--ext/socket/ancdata.c4
2 files changed, 6 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 53211ac7d9..78cdef9dfa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Mon Mar 2 21:26:42 2009 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/ancdata.c (anc_inspect_socket_creds): supress warnings.
+
Mon Mar 2 21:13:42 2009 Tanaka Akira <akr@fsij.org>
* ext/socket/ancdata.c (rsock_discard_cmsg_resource): defined
diff --git a/ext/socket/ancdata.c b/ext/socket/ancdata.c
index 56aa5ed1f0..d76cce98f8 100644
--- a/ext/socket/ancdata.c
+++ b/ext/socket/ancdata.c
@@ -742,10 +742,10 @@ anc_inspect_socket_creds(int level, int type, VALUE data, VALUE ret)
}
#endif
#if defined(HAVE_TYPE_STRUCT_SOCKCRED) /* FreeBSD, NetBSD */
- if (RSTRING_LEN(data) >= SOCKCREDSIZE(0)) {
+ if ((size_t)RSTRING_LEN(data) >= SOCKCREDSIZE(0)) {
struct sockcred cred0, *cred;
memcpy(&cred0, RSTRING_PTR(data), SOCKCREDSIZE(0));
- if (RSTRING_LEN(data) == SOCKCREDSIZE(cred0.sc_ngroups)) {
+ if ((size_t)RSTRING_LEN(data) == SOCKCREDSIZE(cred0.sc_ngroups)) {
cred = (struct sockcred *)ALLOCA_N(char, SOCKCREDSIZE(cred0.sc_ngroups));
memcpy(cred, RSTRING_PTR(data), SOCKCREDSIZE(cred0.sc_ngroups));
rb_str_catf(ret, " uid=%u", cred->sc_uid);