summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_runtime.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2017-03-14 19:52:57 +0300
committerIgor Sysoev <igor@sysoev.ru>2017-03-14 19:52:57 +0300
commite13cbdb439b801685708231b18bca6181d8c4592 (patch)
tree25898235ef3b6977460e78d592f4569887b89fe1 /src/nxt_runtime.c
parent5135fcea930985dab45085033c5aae54c6ad1a65 (diff)
downloadunit-e13cbdb439b801685708231b18bca6181d8c4592.tar.gz
unit-e13cbdb439b801685708231b18bca6181d8c4592.tar.bz2
Solaris compatibilty.
Diffstat (limited to '')
-rw-r--r--src/nxt_runtime.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/nxt_runtime.c b/src/nxt_runtime.c
index 190d0459..84812cae 100644
--- a/src/nxt_runtime.c
+++ b/src/nxt_runtime.c
@@ -1106,18 +1106,18 @@ invalid_address:
static nxt_sockaddr_t *
nxt_runtime_sockaddr_inet_parse(nxt_task_t *task, nxt_mem_pool_t *mp,
- nxt_str_t *addr)
+ nxt_str_t *string)
{
u_char *p, *ip;
size_t length;
- in_addr_t s_addr;
+ in_addr_t addr;
nxt_int_t port;
nxt_sockaddr_t *sa;
- s_addr = INADDR_ANY;
+ addr = INADDR_ANY;
- length = addr->length;
- ip = addr->start;
+ length = string->length;
+ ip = string->start;
p = nxt_memchr(ip, ':', length);
@@ -1137,9 +1137,9 @@ nxt_runtime_sockaddr_inet_parse(nxt_task_t *task, nxt_mem_pool_t *mp,
} else {
/* "x.x.x.x" */
- s_addr = nxt_inet_addr(ip, length);
+ addr = nxt_inet_addr(ip, length);
- if (s_addr == INADDR_NONE) {
+ if (addr == INADDR_NONE) {
goto invalid_port;
}
@@ -1161,9 +1161,9 @@ nxt_runtime_sockaddr_inet_parse(nxt_task_t *task, nxt_mem_pool_t *mp,
length = (p - 1) - ip;
if (length != 1 || ip[0] != '*') {
- s_addr = nxt_inet_addr(ip, length);
+ addr = nxt_inet_addr(ip, length);
- if (s_addr == INADDR_NONE) {
+ if (addr == INADDR_NONE) {
goto invalid_addr;
}
@@ -1181,19 +1181,19 @@ nxt_runtime_sockaddr_inet_parse(nxt_task_t *task, nxt_mem_pool_t *mp,
sa->u.sockaddr_in.sin_family = AF_INET;
sa->u.sockaddr_in.sin_port = htons((in_port_t) port);
- sa->u.sockaddr_in.sin_addr.s_addr = s_addr;
+ sa->u.sockaddr_in.sin_addr.s_addr = addr;
return sa;
invalid_port:
- nxt_log(task, NXT_LOG_CRIT, "invalid port in \"%V\"", addr);
+ nxt_log(task, NXT_LOG_CRIT, "invalid port in \"%V\"", string);
return NULL;
invalid_addr:
- nxt_log(task, NXT_LOG_CRIT, "invalid address in \"%V\"", addr);
+ nxt_log(task, NXT_LOG_CRIT, "invalid address in \"%V\"", string);
return NULL;
}