Skip to content

Commit f7931d6

Browse files
committed
Cleanup
1 parent 84ef22b commit f7931d6

File tree

4 files changed

+0
-43
lines changed

4 files changed

+0
-43
lines changed

ext/socket/selector-epoll.c

-13
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,6 @@ static void add_socket_ctx(unix_context_t *ctx, SgObject slot)
4949
epoll_ctl(ctx->fd, EPOLL_CTL_ADD, socket->socket, &ev);
5050
}
5151

52-
static void add_socket(SgSocketSelector *selector, SgObject slot)
53-
{
54-
/* unix_context_t *ctx = (unix_context_t *)selector->context; */
55-
/* add_socket_ctx(ctx, slot); */
56-
}
57-
5852
static void remove_socket_ctx(unix_context_t *ctx, SgSocket *socket)
5953
{
6054
/* BUG on kernel < 2.6.9 */
@@ -64,13 +58,6 @@ static void remove_socket_ctx(unix_context_t *ctx, SgSocket *socket)
6458
epoll_ctl(ctx->fd, EPOLL_CTL_DEL, socket->socket, &ev);
6559
}
6660

67-
static void remove_socket(SgSocketSelector *selector, SgSocket *socket)
68-
{
69-
/* unix_context_t *ctx = (unix_context_t *)selector->context; */
70-
/* remove_socket_ctx(ctx, socket); */
71-
}
72-
73-
7461
static SgObject wait_selector(unix_context_t *ctx, int nsock,
7562
SgObject sockets, struct timespec *sp,
7663
int *err)

ext/socket/selector-kqueue.c

-12
Original file line numberDiff line numberDiff line change
@@ -41,18 +41,6 @@ static int make_selector()
4141
return kqueue();
4242
}
4343

44-
static void add_socket(SgSocketSelector *selector, SgObject slot)
45-
{
46-
/* do nothing :) */
47-
}
48-
49-
50-
static void remove_socket(SgSocketSelector *selector, SgSocket *socket)
51-
{
52-
/* do nothing */
53-
}
54-
55-
5644
static SgObject wait_selector(unix_context_t *ctx, int nsock,
5745
SgObject sockets, struct timespec *sp,
5846
int *err)

ext/socket/selector-win.c

-10
Original file line numberDiff line numberDiff line change
@@ -60,16 +60,6 @@ static void system_error(int code)
6060
Sg_GetLastErrorMessageWithErrorCode(code));
6161
}
6262

63-
static void remove_socket(SgSocketSelector *selector, SgSocket *socket)
64-
{
65-
/* do nothing */
66-
}
67-
68-
static void add_socket(SgSocketSelector *selector, SgObject slot)
69-
{
70-
/* do nothing */
71-
}
72-
7363
static void * make_selector_context()
7464
{
7565
win_context_t *ctx = SG_NEW(win_context_t);

ext/socket/socket-selector.incl

-8
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,6 @@ static struct timespec *selector_timespec(SgObject timeout, struct timespec *tm)
8181
return NULL; /* dummy */
8282
}
8383

84-
static void remove_socket(SgSocketSelector *selector, SgSocket *socket);
85-
8684
SgObject Sg_SocketSelectorClear(SgSocketSelector *selector)
8785
{
8886
SgObject cp;
@@ -91,9 +89,6 @@ SgObject Sg_SocketSelectorClear(SgSocketSelector *selector)
9189
}
9290
Sg_LockMutex(&selector->lock);
9391

94-
SG_FOR_EACH(cp, selector->sockets) {
95-
remove_socket(selector, SG_SOCKET(SG_CAAR(cp)));
96-
}
9792
strip_sockets(selector, SG_NIL); /* strip closed ones */
9893
cp = selector->sockets;
9994
selector->sockets = SG_NIL;
@@ -102,8 +97,6 @@ SgObject Sg_SocketSelectorClear(SgSocketSelector *selector)
10297
return cp;
10398
}
10499

105-
static void add_socket(SgSocketSelector *selector, SgObject slot);
106-
107100
SgObject Sg_SocketSelectorAdd(SgSocketSelector *selector,
108101
SgSocket *socket,
109102
SgObject timeout,
@@ -130,7 +123,6 @@ SgObject Sg_SocketSelectorAdd(SgSocketSelector *selector,
130123
}
131124
Sg_LockMutex(&selector->lock);
132125
slot = Sg_Cons(socket, Sg_Cons(to, data));
133-
add_socket(selector, slot);
134126
selector->sockets = Sg_Cons(slot, selector->sockets);
135127
strip_sockets(selector, SG_NIL);
136128
if (selector->waiting && !selector->retry) {

0 commit comments

Comments
 (0)