aboutsummaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2003-06-15 18:32:13 +0000
committerIgor Sysoev <igor@sysoev.ru>2003-06-15 18:32:13 +0000
commitbe2cfc3d28c90b0e911f22d6f14ce927b7f5bfad (patch)
tree52bcfd54a3779fd021278e28dffad5d5bd2f2f4a /src/core
parent0915977df53c486abbc6081e1c83f9f8e7a8f111 (diff)
downloadnginx-be2cfc3d28c90b0e911f22d6f14ce927b7f5bfad.tar.gz
nginx-be2cfc3d28c90b0e911f22d6f14ce927b7f5bfad.zip
nginx-0.0.1-2003-06-15-22:32:13 import
Diffstat (limited to 'src/core')
-rw-r--r--src/core/nginx.c4
-rw-r--r--src/core/ngx_conf_file.h5
-rw-r--r--src/core/ngx_log.c3
-rw-r--r--src/core/ngx_log.h5
4 files changed, 17 insertions, 0 deletions
diff --git a/src/core/nginx.c b/src/core/nginx.c
index 4f3be980c..28b5fa9fb 100644
--- a/src/core/nginx.c
+++ b/src/core/nginx.c
@@ -41,6 +41,7 @@ int main(int argc, char *const *argv)
/* STUB */ ngx_log.log_level = NGX_LOG_DEBUG;
#endif
+
log = ngx_log_init_errlog();
if (ngx_os_init(log) == NGX_ERROR) {
@@ -230,6 +231,9 @@ static int ngx_open_listening_sockets(ngx_log_t *log)
}
if (failed) {
+
+ /* TODO: configurable */
+
ngx_log_error(NGX_LOG_EMERG, log, 0, "can not bind(), exiting");
return NGX_ERROR;
}
diff --git a/src/core/ngx_conf_file.h b/src/core/ngx_conf_file.h
index 046ee2c75..07deeb6a1 100644
--- a/src/core/ngx_conf_file.h
+++ b/src/core/ngx_conf_file.h
@@ -102,6 +102,11 @@ struct ngx_conf_s {
conf = default; \
}
+#define ngx_conf_init_unsigned_value(conf, default) \
+ if (conf == (unsigned) NGX_CONF_UNSET) { \
+ conf = default; \
+ }
+
#define ngx_conf_init_size_value(conf, default) \
if (conf == NGX_CONF_UNSET) { \
conf = default; \
diff --git a/src/core/ngx_log.c b/src/core/ngx_log.c
index 3da25f0a5..5acbaba73 100644
--- a/src/core/ngx_log.c
+++ b/src/core/ngx_log.c
@@ -219,6 +219,7 @@ static char *ngx_set_error_log(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
ngx_log_t *ngx_log_init_errlog()
{
#if (WIN32)
+
ngx_log.fd = GetStdHandle(STD_ERROR_HANDLE);
if (ngx_log.fd == NGX_INVALID_FILE) {
@@ -231,7 +232,9 @@ ngx_log_t *ngx_log_init_errlog()
}
#else
+
ngx_log.fd = STDERR_FILENO;
+
#endif
ngx_log.log_level = NGX_LOG_INFO;
diff --git a/src/core/ngx_log.h b/src/core/ngx_log.h
index d1d382c45..7707acdd7 100644
--- a/src/core/ngx_log.h
+++ b/src/core/ngx_log.h
@@ -68,10 +68,12 @@ typedef struct {
ngx_fd_t fd;
void *data;
size_t (*handler)(void *ctx, char *buf, size_t len);
+#if 0
/* STUB */
char *action;
char *context;
/* */
+#endif
} ngx_log_t;
#define MAX_ERROR_STR 2048
@@ -161,6 +163,9 @@ void ngx_assert_core(ngx_log_t *log, const char *fmt, ...);
#endif /* VARIADIC MACROS */
+#define ngx_log_alloc_log(pool, log) ngx_palloc(pool, log, sizeof(ngx_log_t))
+#define ngx_log_copy_log(new, old) ngx_memcpy(new, old, sizeof(ngx_log_t))
+
ngx_log_t *ngx_log_init_errlog();
char *ngx_log_set_errlog(ngx_conf_t *cf, ngx_command_t *cmd, ngx_log_t *log);