diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/nxt_buf.c | 2 | ||||
-rw-r--r-- | src/nxt_python_wsgi.c | 12 | ||||
-rw-r--r-- | src/nxt_runtime.c | 24 | ||||
-rw-r--r-- | src/nxt_unix.h | 6 |
4 files changed, 23 insertions, 21 deletions
diff --git a/src/nxt_buf.c b/src/nxt_buf.c index d2b6fe7a..cee1392e 100644 --- a/src/nxt_buf.c +++ b/src/nxt_buf.c @@ -18,7 +18,7 @@ nxt_buf_mem_init(nxt_buf_t *b, void *start, size_t size) b->mem.start = start; b->mem.pos = start; b->mem.free = start; - b->mem.end = start + size; + b->mem.end = (u_char *) start + size; } diff --git a/src/nxt_python_wsgi.c b/src/nxt_python_wsgi.c index 30bd4939..da2b4d76 100644 --- a/src/nxt_python_wsgi.c +++ b/src/nxt_python_wsgi.c @@ -10,10 +10,6 @@ #include <compile.h> #include <node.h> -#ifdef _DARWIN_C_SOURCE -#undef _DARWIN_C_SOURCE -#endif - #include <nxt_main.h> #include <nxt_runtime.h> #include <nxt_application.h> @@ -426,7 +422,7 @@ nxt_python_run(nxt_app_request_t *r) static PyObject * nxt_python_create_environ(nxt_thread_t *thr) { - PyObject *obj, *stderr, *environ; + PyObject *obj, *err, *environ; environ = PyDict_New(); @@ -527,14 +523,14 @@ nxt_python_create_environ(nxt_thread_t *thr) obj = NULL; - stderr = PySys_GetObject((char *) "stderr"); + err = PySys_GetObject((char *) "stderr"); - if (nxt_slow_path(stderr == NULL)) { + if (nxt_slow_path(err == NULL)) { nxt_log_alert(thr->log, "Python failed to get \"sys.stderr\" object"); goto fail; } - if (nxt_slow_path(PyDict_SetItemString(environ, "wsgi.error", stderr) != 0)) + if (nxt_slow_path(PyDict_SetItemString(environ, "wsgi.error", err) != 0)) { nxt_log_alert(thr->log, "Python failed to set the \"wsgi.error\" environ value"); 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; } diff --git a/src/nxt_unix.h b/src/nxt_unix.h index 6f2e280b..8bcc8825 100644 --- a/src/nxt_unix.h +++ b/src/nxt_unix.h @@ -69,7 +69,9 @@ #define _REENTRANT /* Thread safe errno. */ #endif +#ifndef _POSIX_PTHREAD_SEMANTICS #define _POSIX_PTHREAD_SEMANTICS /* 2 arguments in sigwait(). */ +#endif /* * Solaris provides two sockets API: @@ -84,7 +86,9 @@ #define _XOPEN_SOURCE #define _XOPEN_SOURCE_EXTENDED 1 /* Enable Solaris extensions disabled by _XOPEN_SOURCE. */ +#ifndef __EXTENSIONS__ #define __EXTENSIONS__ +#endif #endif /* NXT_SOLARIS */ @@ -92,7 +96,9 @@ #if (NXT_MACOSX) #define _XOPEN_SOURCE /* ucontext(3). */ +#ifndef _DARWIN_C_SOURCE #define _DARWIN_C_SOURCE /* pthread_threadid_np(), mach_port_t. */ +#endif #include <mach/mach_time.h> /* mach_absolute_time(). */ #include <malloc/malloc.h> /* malloc_size(). */ |