[#7872] Nonblocking socket-connect — "Francis Cianfrocca" <garbagecat10@...>

All, I needed a nonblocking socket connect for my asynchronous-event

18 messages 2006/05/14
[#7873] Re: Nonblocking socket-connect — Tanaka Akira <akr@...17n.org> 2006/05/14

In article <3a94cf510605140559l7baa0205le341dac4f47d424b@mail.gmail.com>,

[#7874] Re: Nonblocking socket-connect — "Francis Cianfrocca" <garbagecat10@...> 2006/05/15

How about introducing the method Socket#set_nonblocking, or alternatively

[#7875] Re: Nonblocking socket-connect — Yukihiro Matsumoto <matz@...> 2006/05/15

Hi,

[#7876] Re: Nonblocking socket-connect — "Francis Cianfrocca" <garbagecat10@...> 2006/05/15

Well, it's ok then. I'm comfortable adding in the nonblocking

[#7877] Re: Nonblocking socket-connect — Yukihiro Matsumoto <matz@...> 2006/05/15

Hi,

Re: Coverity: Patch/Fix CID 17 OVERRUN_STATIC File: ruby/signal.c

From: ville.mattila@...
Date: 2006-05-05 04:38:47 UTC
List: ruby-core #7824
Hello Kevin,

>static struct {
>VALUE cmd;
>int safe;
>} trap_list[NSIG];
>
>633         if (sig < 0 || sig > NSIG) {
>634             rb_raise(rb_eArgError, "invalid signal number (%d)", sig);
>635         }
>
>trap_list is only NSIG big so the "if" should be >=NSIG
>Arrays are zero based in C.

   I agree that this is a valid bug. When I checked this, I couldn't find
whether ruby
  map given signal number to correct C array number e.g signal 1 -> becomes
0 and
  so on.  If ruby does not do this it is a bug, because then we lost the
last signal (the signal
 with the biggest number). So we probably should do sig = sig - 1 in the
begin of the function?



>
>
>Index: signal.c
>===================================================================
>RCS file: /src/ruby/signal.c,v
>retrieving revision 1.72
>diff -u -r1.72 signal.c
>--- signal.c    9 Jan 2006 22:32:55 -0000       1.72
>+++ signal.c    5 May 2006 02:24:42 -0000
>@@ -630,7 +630,7 @@
>rb_raise(rb_eArgError, "unsupported signal SIG%s", s);
>}
>
>-    if (sig < 0 || sig > NSIG) {
>+    if (sig < 0 || sig >= NSIG) {
>rb_raise(rb_eArgError, "invalid signal number (%d)", sig);
>}
>#if defined(HAVE_SETITIMER)
>
>



In This Thread

Prev Next