summaryrefslogtreecommitdiff
path: root/ext/socket
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-04-14 04:55:53 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-04-14 04:55:53 +0000
commita1a693e138392467ca74fb4ba5b071dd7675960e (patch)
tree7586388b543e40af025fa9e03a63b442eb254009 /ext/socket
parentd453b1a042a4483e74b17d66c7d88ec0c60b964a (diff)
signal delivered to main_thread
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@166 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/socket')
-rw-r--r--ext/socket/socket.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/ext/socket/socket.c b/ext/socket/socket.c
index 0b3090124a..5aaff22c04 100644
--- a/ext/socket/socket.c
+++ b/ext/socket/socket.c
@@ -94,6 +94,7 @@ sock_new(class, fd)
fp->f2 = rb_fdopen(fd, "w");
fp->mode = FMODE_READWRITE;
io_unbuffered(fp);
+ obj_call_init((VALUE)sock);
return (VALUE)sock;
}
@@ -543,7 +544,6 @@ tcp_s_open(class, host, serv)
VALUE s;
Check_SafeStr(host);
s = open_inet(class, host, serv, INET_CLIENT);
- obj_call_init(s);
return s;
}
@@ -562,7 +562,6 @@ socks_s_open(class, host, serv)
Check_SafeStr(host);
s = open_inet(class, host, serv, INET_SOCKS);
- obj_call_init(s);
return s;
}
#endif
@@ -579,7 +578,6 @@ tcp_svr_s_open(argc, argv, class)
s = open_inet(class, arg1, arg2, INET_SERVER);
else
s = open_inet(class, 0, arg1, INET_SERVER);
- obj_call_init(s);
return s;
}
@@ -812,7 +810,6 @@ udp_s_open(class)
VALUE s;
s = sock_new(class, socket(AF_INET, SOCK_DGRAM, 0));
- obj_call_init(s);
return s;
}
@@ -958,7 +955,6 @@ unix_s_sock_open(sock, path)
{
VALUE s;
s = open_unix(sock, path, 0);
- obj_call_init(s);
return s;
}
@@ -985,7 +981,6 @@ unix_svr_s_open(sock, path)
{
VALUE s;
s = open_unix(sock, path, 1);
- obj_call_init(s);
return s;
}
@@ -1144,20 +1139,15 @@ sock_s_open(class, domain, type, protocol)
setup_domain_and_type(domain, &d, type, &t);
fd = socket(d, t, NUM2INT(protocol));
if (fd < 0) rb_sys_fail("socket(2)");
- s = sock_new(class, fd);
- obj_call_init(s);
- return s;
+ return sock_new(class, fd);
}
static VALUE
sock_s_for_fd(class, fd)
VALUE class, fd;
{
- VALUE s = sock_new(class, NUM2INT(fd));
-
- obj_call_init(s);
- return s;
+ return sock_new(class, NUM2INT(fd));
}
static VALUE