summaryrefslogtreecommitdiff
path: root/ext/socket/raddrinfo.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-09-14 23:26:03 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-09-14 23:26:03 +0000
commit3f4a73f0e1d79184c51d3d696ec06376c323e0b5 (patch)
tree7c30f1ac9d3fd2c86fc6e37742893a0c5aa70304 /ext/socket/raddrinfo.c
parent757f5bcb971d2fa1edeaccce0f4fd877c12b0b6d (diff)
* ext/socket/raddrinfo.c (ruby_getaddrinfo__darwin): suppress a
warning. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29255 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/socket/raddrinfo.c')
-rw-r--r--ext/socket/raddrinfo.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/ext/socket/raddrinfo.c b/ext/socket/raddrinfo.c
index 283b1ff..eff5d66 100644
--- a/ext/socket/raddrinfo.c
+++ b/ext/socket/raddrinfo.c
@@ -102,11 +102,13 @@ static int str_is_number(const char *);
#if defined(__APPLE__)
static int
ruby_getaddrinfo__darwin(const char *nodename, const char *servname,
- struct addrinfo *hints, struct addrinfo **res)
+ const struct addrinfo *hints, struct addrinfo **res)
{
/* fix [ruby-core:29427] */
const char *tmp_servname;
struct addrinfo tmp_hints;
+ int error;
+
tmp_servname = servname;
MEMCPY(&tmp_hints, hints, struct addrinfo, 1);
if (nodename && servname) {
@@ -117,10 +119,9 @@ ruby_getaddrinfo__darwin(const char *nodename, const char *servname,
#endif
}
}
- int error = getaddrinfo(nodename, tmp_servname, &tmp_hints, res);
- if (error == 0)
- {
+ error = getaddrinfo(nodename, tmp_servname, &tmp_hints, res);
+ if (error == 0) {
/* [ruby-dev:23164] */
struct addrinfo *r;
r = *res;