From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS6939 64.71.128.0/18 X-Spam-Status: No, score=-1.4 required=3.0 tests=AWL,BAYES_00, MSGID_FROM_MTA_HEADER shortcircuit=no autolearn=unavailable version=3.3.2 Path: news.gmane.org!not-for-mail From: Jeremy Evans Newsgroups: gmane.comp.lang.ruby.kgio.general Subject: Fixes for OpenBSD Date: Thu, 5 May 2011 11:18:46 -0700 Message-ID: <20110505181846.GB9693@jeremyevans.local> References: <20110505181846.GB9693@jeremyevans.local> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1304619549 18389 80.91.229.12 (5 May 2011 18:19:09 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 5 May 2011 18:19:09 +0000 (UTC) To: kgio@librelist.com Original-X-From: kgio@librelist.com Thu May 05 20:19:05 2011 Return-path: Envelope-to: gclrkg-kgio@m.gmane.org In-Reply-To: <20110505181846.GB9693@jeremyevans.local> List-Archive: List-Help: List-Id: List-Post: List-Subscribe: List-Unsubscribe: Precedence: list Original-Sender: kgio@librelist.com Xref: news.gmane.org gmane.comp.lang.ruby.kgio.general:17 Archived-At: Received: from zedshaw.xen.prgmr.com ([64.71.167.205]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QI38i-0003fI-OU for gclrkg-kgio@m.gmane.org; Thu, 05 May 2011 20:19:05 +0200 Received: from zedshaw.xen.prgmr.com (localhost [IPv6:::1]) by zedshaw.xen.prgmr.com (Postfix) with ESMTP id 5318421C987 for ; Thu, 5 May 2011 18:20:10 +0000 (UTC) I'm not sure if these issues are specific to OpenBSD or not, but they are required on OpenBSD. With these two patches, kgio-2.3.3 passes the included tests on OpenBSD except for one failure: 1) Failure: test_wait_writable_set(TestKgioTcpConnect) [test/test_tcp_connect.rb:69]: <"waited"> expected but was . Hope this helps, Jeremy Fix kgio_peek by adding an empty kgio_autopush_recv if !KGIO_NOPUSH. --- ext/kgio/autopush.c.orig Thu May 5 11:02:08 2011 +++ ext/kgio/autopush.c Thu May 5 11:02:12 2011 @@ -242,6 +242,7 @@ static void push_pending_data(VALUE io) rb_sys_fail("setsockopt(TCP_CORK/TCP_NOPUSH, 1)"); } #else /* !KGIO_NOPUSH */ +void kgio_autopush_recv(VALUE io){} void init_kgio_autopush(void) { } getaddrinfo gives an error if you use AF_UNSPEC as the ai_family, the man page says PF_UNSPEC should be used. And other entries in hints need to be 0 or NULL. --- ext/kgio/connect.c.orig Wed Dec 31 16:00:00 1969 +++ ext/kgio/connect.c Thu May 5 10:47:10 2011 @@ -69,7 +69,8 @@ static VALUE tcp_connect(VALUE klass, VALUE ip, VALUE rc = snprintf(ipport, sizeof(ipport), "%u", uport); if (rc >= (int)sizeof(ipport) || rc <= 0) rb_raise(rb_eArgError, "invalid TCP port: %u", uport); - hints.ai_family = AF_UNSPEC; + memset(&hints, 0, sizeof(hints)); + hints.ai_family = PF_UNSPEC; hints.ai_socktype = SOCK_STREAM; hints.ai_protocol = IPPROTO_TCP; /* disallow non-deterministic DNS lookups */