mirror of
https://github.com/libuv/libuv
synced 2025-03-28 21:13:16 +00:00
unix,test: deadstore fixes
Fixes deadstore in uv_pipe_bind as 'sockfd' is no longer used. Fixes deadstore in test related to unused variables or missing assert. PR-URL: https://github.com/libuv/libuv/pull/1288 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
This commit is contained in:
parent
36d6b1f445
commit
cd676e2dbc
@ -47,7 +47,6 @@ int uv_pipe_bind(uv_pipe_t* handle, const char* name) {
|
||||
int err;
|
||||
|
||||
pipe_fname = NULL;
|
||||
sockfd = -1;
|
||||
|
||||
/* Already bound? */
|
||||
if (uv__stream_fd(handle) >= 0)
|
||||
|
@ -46,7 +46,6 @@ static char socket_cb_read_buf[1024];
|
||||
|
||||
static void socket_cb(uv_poll_t* poll, int status, int events) {
|
||||
ssize_t cnt;
|
||||
cnt = 0;
|
||||
socket_cb_called++;
|
||||
ASSERT(0 == status);
|
||||
printf("Socket cb got events %d\n", events);
|
||||
|
@ -1485,6 +1485,7 @@ TEST_IMPL(fs_chown) {
|
||||
/* chown to root (fail) */
|
||||
chown_cb_count = 0;
|
||||
r = uv_fs_chown(loop, &req, "test_file", 0, 0, chown_root_cb);
|
||||
ASSERT(r == 0);
|
||||
uv_run(loop, UV_RUN_DEFAULT);
|
||||
ASSERT(chown_cb_count == 1);
|
||||
|
||||
|
@ -67,6 +67,7 @@ TEST_IMPL(shutdown_twice) {
|
||||
loop = uv_default_loop();
|
||||
|
||||
r = uv_tcp_init(loop, &h);
|
||||
ASSERT(r == 0);
|
||||
|
||||
r = uv_tcp_connect(&connect_req,
|
||||
&h,
|
||||
|
@ -136,6 +136,7 @@ TEST_IMPL(udp_send_immediate) {
|
||||
1,
|
||||
(const struct sockaddr*) &addr,
|
||||
cl_send_cb);
|
||||
ASSERT(r == 0);
|
||||
|
||||
uv_run(uv_default_loop(), UV_RUN_DEFAULT);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user