summaryrefslogtreecommitdiff
path: root/ext/socket/socket.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/socket/socket.c')
-rw-r--r--ext/socket/socket.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/ext/socket/socket.c b/ext/socket/socket.c
index 9527cf3da1..5b7d8ebefb 100644
--- a/ext/socket/socket.c
+++ b/ext/socket/socket.c
@@ -177,8 +177,7 @@ sock_new(class, fd)
int fd;
{
OpenFile *fp;
- NEWOBJ(sock, struct RFile);
- OBJSETUP(sock, class, T_FILE);
+ VALUE sock = rb_obj_alloc(class);
MakeOpenFile(sock, fp);
fp->f = rb_fdopen(fd, "r");
@@ -190,7 +189,7 @@ sock_new(class, fd)
fp->mode = FMODE_READWRITE;
rb_io_synchronized(fp);
- return (VALUE)sock;
+ return sock;
}
static VALUE