Permalink
Browse files

fix the problem of "-Werror=unused-but-set-variable"

  • Loading branch information...
1 parent 1da8877 commit 89b04f51c1083df1ef68cd3323dad42a3e12a8e3 @yaoweibin committed Jul 15, 2011
Showing with 22 additions and 24 deletions.
  1. +22 −24 new_syslog_0.8.54.patch
View
@@ -1,5 +1,5 @@
diff --git a/src/core/ngx_cycle.c b/src/core/ngx_cycle.c
-index 357c6b2..53053da 100644
+index 7986707..9902ef7 100644
--- a/src/core/ngx_cycle.c
+++ b/src/core/ngx_cycle.c
@@ -84,6 +84,12 @@ ngx_init_cycle(ngx_cycle_t *old_cycle)
@@ -16,7 +16,7 @@ index 357c6b2..53053da 100644
cycle->conf_prefix.len = old_cycle->conf_prefix.len;
diff --git a/src/core/ngx_log.c b/src/core/ngx_log.c
-index c0485c6..649bc67 100644
+index 4433314..9411fc9 100644
--- a/src/core/ngx_log.c
+++ b/src/core/ngx_log.c
@@ -9,6 +9,15 @@
@@ -165,7 +165,7 @@ index c0485c6..649bc67 100644
{
return;
}
-@@ -361,6 +446,50 @@ ngx_log_create(ngx_cycle_t *cycle, ngx_str_t *name)
+@@ -364,6 +449,50 @@ ngx_log_create(ngx_cycle_t *cycle, ngx_str_t *name)
return log;
}
@@ -216,7 +216,7 @@ index c0485c6..649bc67 100644
char *
-@@ -421,6 +550,13 @@ static char *
+@@ -424,6 +553,13 @@ static char *
ngx_error_log(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
{
ngx_str_t *value, name;
@@ -230,7 +230,7 @@ index c0485c6..649bc67 100644
if (cf->cycle->new_log.file) {
return "is duplicate";
-@@ -428,7 +564,44 @@ ngx_error_log(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
+@@ -431,7 +567,44 @@ ngx_error_log(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
value = cf->args->elts;
@@ -275,7 +275,7 @@ index c0485c6..649bc67 100644
ngx_str_null(&name);
} else {
-@@ -449,3 +622,63 @@ ngx_error_log(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
+@@ -452,3 +625,63 @@ ngx_error_log(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
return ngx_log_set_levels(cf, &cf->cycle->new_log);
}
@@ -383,7 +383,7 @@ index 1054836..14288ee 100644
void ngx_cdecl ngx_log_abort(ngx_err_t err, const char *fmt, ...);
void ngx_cdecl ngx_log_stderr(ngx_err_t err, const char *fmt, ...);
diff --git a/src/http/modules/ngx_http_log_module.c b/src/http/modules/ngx_http_log_module.c
-index 5f356c3..3724f27 100644
+index e6a7fdb..51c4384 100644
--- a/src/http/modules/ngx_http_log_module.c
+++ b/src/http/modules/ngx_http_log_module.c
@@ -8,6 +8,11 @@
@@ -410,15 +410,13 @@ index 5f356c3..3724f27 100644
} ngx_http_log_t;
-@@ -314,11 +324,30 @@ ngx_http_log_write(ngx_http_request_t *r, ngx_http_log_t *log, u_char *buf,
+@@ -318,11 +328,27 @@ ngx_http_log_write(ngx_http_request_t *r, ngx_http_log_t *log, u_char *buf,
time_t now;
ssize_t n;
ngx_err_t err;
+-
++
+#if (NGX_ENABLE_SYSLOG)
-+ ngx_http_log_loc_conf_t *lcf;
-+
-+ lcf = ngx_http_get_module_loc_conf(r, ngx_http_log_module);
-
+ n = 0;
+ if (log->syslog_on) {
+ syslog(log->priority, "%.*s", (int)len, buf);
@@ -441,7 +439,7 @@ index 5f356c3..3724f27 100644
} else {
name = NULL;
n = ngx_http_log_script_write(r, log->script, &name, buf, len);
-@@ -826,6 +855,10 @@ ngx_http_log_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
+@@ -836,6 +862,10 @@ ngx_http_log_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
log->script = NULL;
log->disk_full_time = 0;
log->error_log_time = 0;
@@ -452,7 +450,7 @@ index 5f356c3..3724f27 100644
lmcf = ngx_http_conf_get_module_main_conf(cf, ngx_http_log_module);
fmt = lmcf->formats.elts;
-@@ -851,6 +884,13 @@ ngx_http_log_set_log(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
+@@ -861,6 +891,13 @@ ngx_http_log_set_log(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
ngx_http_log_main_conf_t *lmcf;
ngx_http_script_compile_t sc;
@@ -466,7 +464,7 @@ index 5f356c3..3724f27 100644
value = cf->args->elts;
if (ngx_strcmp(value[1].data, "off") == 0) {
-@@ -863,6 +903,38 @@ ngx_http_log_set_log(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
+@@ -873,6 +910,38 @@ ngx_http_log_set_log(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
"invalid parameter \"%V\"", &value[2]);
return NGX_CONF_ERROR;
}
@@ -505,7 +503,7 @@ index 5f356c3..3724f27 100644
if (llcf->logs == NULL) {
llcf->logs = ngx_array_create(cf->pool, 2, sizeof(ngx_http_log_t));
-@@ -880,6 +952,52 @@ ngx_http_log_set_log(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
+@@ -890,6 +959,52 @@ ngx_http_log_set_log(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
ngx_memzero(log, sizeof(ngx_http_log_t));
@@ -558,7 +556,7 @@ index 5f356c3..3724f27 100644
n = ngx_http_script_variables_count(&value[1]);
if (n == 0) {
-@@ -887,7 +1005,7 @@ ngx_http_log_set_log(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
+@@ -897,7 +1012,7 @@ ngx_http_log_set_log(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
if (log->file == NULL) {
return NGX_CONF_ERROR;
}
@@ -567,7 +565,7 @@ index 5f356c3..3724f27 100644
} else {
if (ngx_conf_full_name(cf->cycle, &value[1], 0) != NGX_OK) {
return NGX_CONF_ERROR;
-@@ -912,6 +1030,7 @@ ngx_http_log_set_log(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
+@@ -922,6 +1037,7 @@ ngx_http_log_set_log(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
return NGX_CONF_ERROR;
}
}
@@ -576,10 +574,10 @@ index 5f356c3..3724f27 100644
if (cf->args->nelts >= 3) {
name = value[2];
diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c
-index 488688a..ca31cb2 100644
+index 597b64c..d45beb7 100644
--- a/src/http/ngx_http_core_module.c
+++ b/src/http/ngx_http_core_module.c
-@@ -1404,6 +1404,9 @@ ngx_http_update_location_config(ngx_http_request_t *r)
+@@ -1393,6 +1393,9 @@ ngx_http_update_location_config(ngx_http_request_t *r)
if (r == r->main) {
r->connection->log->file = clcf->error_log->file;
@@ -589,7 +587,7 @@ index 488688a..ca31cb2 100644
if (!(r->connection->log->log_level & NGX_LOG_DEBUG_CONNECTION)) {
r->connection->log->log_level = clcf->error_log->log_level;
-@@ -4259,17 +4262,72 @@ ngx_http_core_error_log(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
+@@ -4280,17 +4283,72 @@ ngx_http_core_error_log(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
ngx_str_t *value;
@@ -663,10 +661,10 @@ index 488688a..ca31cb2 100644
clcf->error_log->log_level = NGX_LOG_ERR;
return NGX_CONF_OK;
diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c
-index f1fab8a..4d9d604 100644
+index 2cef4fa..d9debda 100644
--- a/src/http/ngx_http_request.c
+++ b/src/http/ngx_http_request.c
-@@ -428,6 +428,9 @@ ngx_http_init_request(ngx_event_t *rev)
+@@ -432,6 +432,9 @@ ngx_http_init_request(ngx_event_t *rev)
clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
c->log->file = clcf->error_log->file;
@@ -676,7 +674,7 @@ index f1fab8a..4d9d604 100644
if (!(c->log->log_level & NGX_LOG_DEBUG_CONNECTION)) {
c->log->log_level = clcf->error_log->log_level;
}
-@@ -1759,6 +1762,9 @@ found:
+@@ -1768,6 +1771,9 @@ found:
clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
r->connection->log->file = clcf->error_log->file;

0 comments on commit 89b04f5

Please sign in to comment.