diff options
author | Jeremy Evans <code@jeremyevans.net> | 2011-05-05 11:49:01 -0700 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2011-05-05 12:34:47 -0700 |
commit | 577cf3056d9f3088145aea51bbc09a0c90a7695e (patch) | |
tree | 5019fe1f8a1da31825af8096e06304a984e9c9ca | |
parent | 537e4c341137a45330e28376e8f29da7df44808f (diff) | |
download | kgio-577cf3056d9f3088145aea51bbc09a0c90a7695e.tar.gz |
Some systems like OpenBSD are stricter about irrelevant fields than GNU/Linux. [ew: commit message] ref: http://mid.gmane.org/20110505181846.GB9693@jeremyevans.local Acked-by: Eric Wong <normalperson@yhbt.net>
-rw-r--r-- | ext/kgio/connect.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/ext/kgio/connect.c b/ext/kgio/connect.c index 3b40054..bb1f527 100644 --- a/ext/kgio/connect.c +++ b/ext/kgio/connect.c @@ -69,6 +69,7 @@ static VALUE tcp_connect(VALUE klass, VALUE ip, VALUE port, int io_wait) rc = snprintf(ipport, sizeof(ipport), "%u", uport); if (rc >= (int)sizeof(ipport) || rc <= 0) rb_raise(rb_eArgError, "invalid TCP port: %u", uport); + memset(&hints, 0, sizeof(hints)); hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_STREAM; hints.ai_protocol = IPPROTO_TCP; |