test-getsockname: minor cleanups
This commit is contained in:
parent
48eb98c464
commit
036d5db16f
@ -54,7 +54,6 @@ static void after_shutdown(uv_req_t* req, int status) {
|
||||
|
||||
|
||||
static void after_read(uv_stream_t* handle, ssize_t nread, uv_buf_t buf) {
|
||||
int i;
|
||||
uv_req_t* req;
|
||||
|
||||
if (buf.base) {
|
||||
@ -64,9 +63,9 @@ static void after_read(uv_stream_t* handle, ssize_t nread, uv_buf_t buf) {
|
||||
req = (uv_req_t*) malloc(sizeof *req);
|
||||
uv_req_init(req, (uv_handle_t*)handle, (void *(*)(void *))after_shutdown);
|
||||
uv_shutdown(req);
|
||||
|
||||
}
|
||||
|
||||
|
||||
static void on_connection(uv_handle_t* server, int status) {
|
||||
struct sockaddr sockname;
|
||||
int namelen = sizeof(sockname);
|
||||
@ -125,7 +124,7 @@ static int tcp_listener(int port) {
|
||||
struct sockaddr sockname;
|
||||
int namelen = sizeof(sockname);
|
||||
int r;
|
||||
|
||||
|
||||
r = uv_tcp_init(&tcpServer);
|
||||
if (r) {
|
||||
fprintf(stderr, "Socket creation error\n");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user