diff options
author | Max Romanov <max.romanov@nginx.com> | 2017-10-04 15:02:00 +0300 |
---|---|---|
committer | Max Romanov <max.romanov@nginx.com> | 2017-10-04 15:02:00 +0300 |
commit | f869bf1b020ed41d5a64b106ba48ec45412b912c (patch) | |
tree | ff4e48ce4288a6ace271031154f43adda509f324 /src/nxt_runtime.c | |
parent | 85e485776b9c52e1762e6cc53406e956c604d9de (diff) | |
download | unit-f869bf1b020ed41d5a64b106ba48ec45412b912c.tar.gz unit-f869bf1b020ed41d5a64b106ba48ec45412b912c.tar.bz2 |
Return error codes for port_hash operations.
Diffstat (limited to 'src/nxt_runtime.c')
-rw-r--r-- | src/nxt_runtime.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/nxt_runtime.c b/src/nxt_runtime.c index a96f4cea..be88fc30 100644 --- a/src/nxt_runtime.c +++ b/src/nxt_runtime.c @@ -1859,11 +1859,16 @@ nxt_runtime_port_first(nxt_runtime_t *rt, nxt_lvlhsh_each_t *lhe) void nxt_runtime_port_add(nxt_task_t *task, nxt_port_t *port) { + nxt_int_t res; nxt_runtime_t *rt; rt = task->thread->runtime; - nxt_port_hash_add(&rt->ports, port); + res = nxt_port_hash_add(&rt->ports, port); + + if (res != NXT_OK) { + return; + } rt->port_by_type[port->type] = port; @@ -1874,11 +1879,16 @@ nxt_runtime_port_add(nxt_task_t *task, nxt_port_t *port) void nxt_runtime_port_remove(nxt_task_t *task, nxt_port_t *port) { + nxt_int_t res; nxt_runtime_t *rt; rt = task->thread->runtime; - nxt_port_hash_remove(&rt->ports, port); + res = nxt_port_hash_remove(&rt->ports, port); + + if (res != NXT_OK) { + return; + } if (rt->port_by_type[port->type] == port) { rt->port_by_type[port->type] = NULL; |