Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 9d274e8

Browse files
author
Yorick Peterse
committedDec 18, 2015
Removed Socketable/io_accept primitive
This is no longer in use by rubysl-socket and serves no further purpose.
1 parent 5a78231 commit 9d274e8

File tree

3 files changed

+0
-44
lines changed

3 files changed

+0
-44
lines changed
 

‎kernel/bootstrap/io.rb

-7
Original file line numberDiff line numberDiff line change
@@ -145,13 +145,6 @@ def socket_recv(bytes, flags, type)
145145
raise PrimitiveFailure, "io_socket_read failed"
146146
end
147147

148-
module Socketable
149-
def accept
150-
Rubinius.primitive :io_accept
151-
raise PrimitiveFailure, "io_accept failed"
152-
end
153-
end
154-
155148
module TransferIO
156149
def send_io
157150
Rubinius.primitive :io_send_io

‎vm/builtin/io.cpp

-34
Original file line numberDiff line numberDiff line change
@@ -1230,40 +1230,6 @@ namespace rubinius {
12301230

12311231

12321232
/** Socket methods */
1233-
Object* IO::accept(STATE, CallFrame* calling_environment) {
1234-
int fd = descriptor()->to_native();
1235-
int new_fd = -1;
1236-
1237-
struct sockaddr_storage socka;
1238-
socklen_t sock_len = sizeof(socka);
1239-
1240-
retry:
1241-
state->vm()->interrupt_with_signal();
1242-
state->vm()->thread->sleep(state, cTrue);
1243-
1244-
{
1245-
GCIndependent guard(state, calling_environment);
1246-
new_fd = ::accept(fd, (struct sockaddr*)&socka, &sock_len);
1247-
}
1248-
1249-
state->vm()->thread->sleep(state, cFalse);
1250-
state->vm()->clear_waiter();
1251-
1252-
if(new_fd == -1) {
1253-
if(errno == EAGAIN || errno == EINTR) {
1254-
if(!state->check_async(calling_environment)) return NULL;
1255-
ensure_open(state);
1256-
goto retry;
1257-
} else {
1258-
Exception::errno_error(state, "accept(2) failed");
1259-
}
1260-
1261-
return NULL;
1262-
}
1263-
1264-
return Fixnum::from(new_fd);
1265-
}
1266-
12671233
static const int cmsg_space = CMSG_SPACE(sizeof(int));
12681234

12691235
Object* IO::send_io(STATE, IO* io) {

‎vm/builtin/io.hpp

-3
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,6 @@ namespace rubinius {
121121
// Rubinius.primitive :io_close
122122
Object* close(STATE);
123123

124-
// Rubinius.primitive :io_accept
125-
Object* accept(STATE, CallFrame* calling_environment);
126-
127124
// Rubinius.primitive :io_send_io
128125
Object* send_io(STATE, IO* io);
129126

0 commit comments

Comments
 (0)
Please sign in to comment.