summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMax Romanov <max.romanov@nginx.com>2021-08-03 13:59:27 +0300
committerMax Romanov <max.romanov@nginx.com>2021-08-03 13:59:27 +0300
commitdb03dfad6745a7d87d784ac51ed2d52e1c50a557 (patch)
tree9ba539d5873f9f008e5a5c4ab9b013fd1ec44d5e
parentfa9fb29be221e0393562831a9e3bcba416652f60 (diff)
downloadunit-db03dfad6745a7d87d784ac51ed2d52e1c50a557.tar.gz
unit-db03dfad6745a7d87d784ac51ed2d52e1c50a557.tar.bz2
Fixed dead assignments.
Found by Clang Static Analyzer.
-rw-r--r--src/nxt_buf.c2
-rw-r--r--src/nxt_event_engine.c3
-rwxr-xr-xsrc/nxt_h1proto.c1
-rw-r--r--src/nxt_http_chunk_parse.c1
-rw-r--r--src/nxt_isolation.c4
-rw-r--r--src/nxt_main_process.c2
6 files changed, 3 insertions, 10 deletions
diff --git a/src/nxt_buf.c b/src/nxt_buf.c
index 83be0fac..cbde069e 100644
--- a/src/nxt_buf.c
+++ b/src/nxt_buf.c
@@ -201,7 +201,6 @@ nxt_buf_completion(nxt_task_t *task, void *obj, void *data)
nxt_buf_t *b, *next, *parent;
b = obj;
- parent = data;
nxt_debug(task, "buf completion: %p %p", b, b->mem.start);
@@ -275,7 +274,6 @@ nxt_buf_ts_completion(nxt_task_t *task, void *obj, void *data)
nxt_buf_t *b, *next, *parent;
b = obj;
- parent = data;
if (nxt_buf_ts_handle(task, obj, data)) {
return;
diff --git a/src/nxt_event_engine.c b/src/nxt_event_engine.c
index 4384d3b1..78c79bb1 100644
--- a/src/nxt_event_engine.c
+++ b/src/nxt_event_engine.c
@@ -720,11 +720,10 @@ nxt_event_engine_buf_mem_free(nxt_event_engine_t *engine, nxt_buf_t *b)
void
nxt_event_engine_buf_mem_completion(nxt_task_t *task, void *obj, void *data)
{
- nxt_event_engine_t *engine;
nxt_buf_t *b, *next, *parent;
+ nxt_event_engine_t *engine;
b = obj;
- parent = data;
nxt_debug(task, "buf completion: %p %p", b, b->mem.start);
diff --git a/src/nxt_h1proto.c b/src/nxt_h1proto.c
index d3da6942..b683cb22 100755
--- a/src/nxt_h1proto.c
+++ b/src/nxt_h1proto.c
@@ -955,7 +955,6 @@ nxt_h1p_request_body_read(nxt_task_t *task, nxt_http_request_t *r)
} else {
size = nxt_min(body_buffer_size, size);
b->mem.free = nxt_cpymem(b->mem.free, in->mem.pos, size);
- body_buffer_size -= size;
}
in->mem.pos += size;
diff --git a/src/nxt_http_chunk_parse.c b/src/nxt_http_chunk_parse.c
index be3a2023..deab116d 100644
--- a/src/nxt_http_chunk_parse.c
+++ b/src/nxt_http_chunk_parse.c
@@ -253,7 +253,6 @@ nxt_http_chunk_buf_completion(nxt_task_t *task, void *obj, void *data)
nxt_buf_t *b, *next, *parent;
b = obj;
- parent = data;
nxt_debug(task, "buf completion: %p %p", b, b->mem.start);
diff --git a/src/nxt_isolation.c b/src/nxt_isolation.c
index cab0074b..e3cb1f22 100644
--- a/src/nxt_isolation.c
+++ b/src/nxt_isolation.c
@@ -126,10 +126,10 @@ nxt_isolation_main_prefork(nxt_task_t *task, nxt_process_t *process,
return ret;
}
- has_mnt = 0;
-
#if (NXT_HAVE_CLONE_NEWNS)
has_mnt = nxt_is_clone_flag_set(process->isolation.clone.flags, NEWNS);
+#else
+ has_mnt = 0;
#endif
if (process->user_cred->uid == 0 && !has_mnt) {
diff --git a/src/nxt_main_process.c b/src/nxt_main_process.c
index 10bd2518..16c6a297 100644
--- a/src/nxt_main_process.c
+++ b/src/nxt_main_process.c
@@ -347,8 +347,6 @@ nxt_port_main_start_process_handler(nxt_task_t *task, nxt_port_recv_msg_t *msg)
nxt_process_init_t *init;
nxt_common_app_conf_t *app_conf;
- ret = NXT_ERROR;
-
rt = task->thread->runtime;
process = nxt_main_process_new(task, rt);