Remove value store in ready_pos but unread (#2588)
* Remove value store in ready_pos but unread * Move declaration of ready_pos to where it is used * Make discard of return value of tcp_check_accept explicit * Split declaration and var assignment to comply with xform
This commit is contained in:
parent
8403ce4109
commit
9e8b9d8959
|
@ -1192,7 +1192,7 @@ static Scheme_Object *
|
||||||
do_tcp_accept(int argc, Scheme_Object *argv[], Scheme_Object *cust, char **_fail_reason)
|
do_tcp_accept(int argc, Scheme_Object *argv[], Scheme_Object *cust, char **_fail_reason)
|
||||||
/* If _fail_reason is not NULL, never raise an exception. */
|
/* If _fail_reason is not NULL, never raise an exception. */
|
||||||
{
|
{
|
||||||
int was_closed = 0, ready_pos;
|
int was_closed = 0;
|
||||||
Scheme_Object *listener;
|
Scheme_Object *listener;
|
||||||
rktio_fd_t *s;
|
rktio_fd_t *s;
|
||||||
|
|
||||||
|
@ -1204,17 +1204,17 @@ do_tcp_accept(int argc, Scheme_Object *argv[], Scheme_Object *cust, char **_fail
|
||||||
was_closed = LISTENER_WAS_CLOSED(listener);
|
was_closed = LISTENER_WAS_CLOSED(listener);
|
||||||
|
|
||||||
if (!was_closed) {
|
if (!was_closed) {
|
||||||
|
int ready_pos;
|
||||||
ready_pos = tcp_check_accept(listener, NULL);
|
ready_pos = tcp_check_accept(listener, NULL);
|
||||||
if (!ready_pos) {
|
if (!ready_pos) {
|
||||||
scheme_block_until((Scheme_Ready_Fun)tcp_check_accept,
|
scheme_block_until((Scheme_Ready_Fun)tcp_check_accept,
|
||||||
tcp_accept_needs_wakeup,
|
tcp_accept_needs_wakeup,
|
||||||
listener,
|
listener,
|
||||||
0.0);
|
0.0);
|
||||||
ready_pos = tcp_check_accept(listener, NULL);
|
(void)tcp_check_accept(listener, NULL);
|
||||||
}
|
}
|
||||||
was_closed = LISTENER_WAS_CLOSED(listener);
|
was_closed = LISTENER_WAS_CLOSED(listener);
|
||||||
} else
|
}
|
||||||
ready_pos = 0;
|
|
||||||
|
|
||||||
if (was_closed) {
|
if (was_closed) {
|
||||||
if (_fail_reason)
|
if (_fail_reason)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user