Hi,
In message "Re: [ruby-core:18771] Problem with MakeOpenFile"
on Sun, 21 Sep 2008 21:14:34 +0900, Claudio Fiorini <claudio / cfiorini.it> writes:
|static VALUE
|method_rfcomm_initialize(VALUE sock)
|{
| int fd;
| OpenFile *fp;
|
| rb_secure(3);
| fd = ruby_socket(AF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM);
| if (fd < 0) rb_sys_fail("socket(2)");
|
| MakeOpenFile(sock, fp); /* HERE I GET THE SEG FAULT */
|
| fp->f = rb_fdopen(fd, "r");
| fp->f2 = rb_fdopen(fd, "w");
| fp->mode = FMODE_READWRITE;
| rb_io_synchronized(fp);
|
| return sock;
|}
MakeOpenFile takes an IO object for its first argument, where you gave
an class object, since method_rbluez_initialize is a class method of a
class Rblues.
matz.