Welcome! Log In Create A New Profile

Advanced

[nginx] svn commit: r4903 - in branches/stable-1.2: . auto misc src/core src/os/unix src/os/win32

Anonymous User
November 12, 2012 01:40PM
Author: mdounin
Date: 2012-11-12 18:39:51 +0000 (Mon, 12 Nov 2012)
New Revision: 4903
URL: http://trac.nginx.org/nginx/changeset/4903/nginx

Log:
Merge of r4870, r4871, r4890, r4895: minor fixes.

*) Made sure to initialize the entire ngx_file_t structure.
Found by Coverity.

*) Correct plural form for "path" in the whole source base.

*) Removed conditional compilation from waitpid() error test.

There are reports that call to a signal handler for an exited process
despite waitpid() already called for the process may happen on Linux
as well.

*) Style, parentheses instead of braces in misc/GNUMakefile.


Modified:
branches/stable-1.2/
branches/stable-1.2/auto/make
branches/stable-1.2/misc/GNUmakefile
branches/stable-1.2/src/core/ngx_cycle.c
branches/stable-1.2/src/core/ngx_cycle.h
branches/stable-1.2/src/core/ngx_file.c
branches/stable-1.2/src/core/ngx_file.h
branches/stable-1.2/src/os/unix/ngx_process.c
branches/stable-1.2/src/os/unix/ngx_process_cycle.c
branches/stable-1.2/src/os/win32/ngx_process_cycle.c

Index: branches/stable-1.2
===================================================================
--- branches/stable-1.2 2012-11-12 18:00:32 UTC (rev 4902)
+++ branches/stable-1.2 2012-11-12 18:39:51 UTC (rev 4903)

Property changes on: branches/stable-1.2
___________________________________________________________________
Modified: svn:mergeinfo
## -1 +1 ##
-/trunk:4611-4632,4636-4657,4671-4672,4674-4676,4682,4684-4699,4704-4706,4713,4736-4741,4754,4756-4771,4775,4777-4780,4782-4785,4795,4811-4820,4822-4824,4828-4835,4840-4844,4865-4869
+/trunk:4611-4632,4636-4657,4671-4672,4674-4676,4682,4684-4699,4704-4706,4713,4736-4741,4754,4756-4771,4775,4777-4780,4782-4785,4795,4811-4820,4822-4824,4828-4835,4840-4844,4865-4871,4890,4895
\ No newline at end of property
Modified: branches/stable-1.2/auto/make
===================================================================
--- branches/stable-1.2/auto/make 2012-11-12 18:00:32 UTC (rev 4902)
+++ branches/stable-1.2/auto/make 2012-11-12 18:39:51 UTC (rev 4903)
@@ -49,7 +49,7 @@
ngx_all_srcs="$CORE_SRCS"


-# the core dependences and include pathes
+# the core dependences and include paths

ngx_deps=`echo $CORE_DEPS $NGX_AUTO_CONFIG_H $NGX_PCH \
| sed -e "s/ *\([^ ][^ ]*\)/$ngx_regex_cont\1/g" \
@@ -69,7 +69,7 @@
END


-# the http dependences and include pathes
+# the http dependences and include paths

if [ $HTTP = YES ]; then

@@ -95,7 +95,7 @@
fi


-# the mail dependences and include pathes
+# the mail dependences and include paths

if [ $MAIL = YES ]; then


Modified: branches/stable-1.2/misc/GNUmakefile
===================================================================
--- branches/stable-1.2/misc/GNUmakefile 2012-11-12 18:00:32 UTC (rev 4902)
+++ branches/stable-1.2/misc/GNUmakefile 2012-11-12 18:39:51 UTC (rev 4903)
@@ -86,7 +86,7 @@
win32:
./auto/configure \
--with-cc=cl \
- --builddir=${OBJS} \
+ --builddir=$(OBJS) \
--with-debug \
--prefix= \
--conf-path=conf/nginx.conf \
@@ -100,8 +100,8 @@
--http-scgi-temp-path=temp/scgi_temp \
--http-uwsgi-temp-path=temp/uwsgi_temp \
--with-cc-opt=-DFD_SETSIZE=1024 \
- --with-pcre=${OBJS}/lib/${PCRE} \
- --with-zlib=${OBJS}/lib/${ZLIB} \
+ --with-pcre=$(OBJS)/lib/$(PCRE) \
+ --with-zlib=$(OBJS)/lib/$(ZLIB) \
--with-select_module \
--with-http_realip_module \
--with-http_addition_module \
@@ -114,7 +114,7 @@
--with-http_random_index_module \
--with-http_secure_link_module \
--with-mail \
- --with-openssl=${OBJS}/lib/${OPENSSL} \
+ --with-openssl=$(OBJS)/lib/$(OPENSSL) \
--with-openssl-opt=enable-tlsext \
--with-http_ssl_module \
--with-mail_ssl_module \

Modified: branches/stable-1.2/src/core/ngx_cycle.c
===================================================================
--- branches/stable-1.2/src/core/ngx_cycle.c 2012-11-12 18:00:32 UTC (rev 4902)
+++ branches/stable-1.2/src/core/ngx_cycle.c 2012-11-12 18:39:51 UTC (rev 4903)
@@ -118,18 +118,18 @@
}


- n = old_cycle->pathes.nelts ? old_cycle->pathes.nelts : 10;
+ n = old_cycle->paths.nelts ? old_cycle->paths.nelts : 10;

- cycle->pathes.elts = ngx_pcalloc(pool, n * sizeof(ngx_path_t *));
- if (cycle->pathes.elts == NULL) {
+ cycle->paths.elts = ngx_pcalloc(pool, n * sizeof(ngx_path_t *));
+ if (cycle->paths.elts == NULL) {
ngx_destroy_pool(pool);
return NULL;
}

- cycle->pathes.nelts = 0;
- cycle->pathes.size = sizeof(ngx_path_t *);
- cycle->pathes.nalloc = n;
- cycle->pathes.pool = pool;
+ cycle->paths.nelts = 0;
+ cycle->paths.size = sizeof(ngx_path_t *);
+ cycle->paths.nalloc = n;
+ cycle->paths.pool = pool;


if (old_cycle->open_files.part.nelts) {
@@ -334,7 +334,7 @@
}


- if (ngx_create_pathes(cycle, ccf->user) != NGX_OK) {
+ if (ngx_create_paths(cycle, ccf->user) != NGX_OK) {
goto failed;
}

@@ -1038,6 +1038,8 @@

ccf = (ngx_core_conf_t *) ngx_get_conf(cycle->conf_ctx, ngx_core_module);

+ ngx_memzero(&file, sizeof(ngx_file_t));
+
file.name = ccf->pid;
file.log = cycle->log;


Modified: branches/stable-1.2/src/core/ngx_cycle.h
===================================================================
--- branches/stable-1.2/src/core/ngx_cycle.h 2012-11-12 18:00:32 UTC (rev 4902)
+++ branches/stable-1.2/src/core/ngx_cycle.h 2012-11-12 18:39:51 UTC (rev 4903)
@@ -48,7 +48,7 @@
ngx_queue_t reusable_connections_queue;

ngx_array_t listening;
- ngx_array_t pathes;
+ ngx_array_t paths;
ngx_list_t open_files;
ngx_list_t shared_memory;


Modified: branches/stable-1.2/src/core/ngx_file.c
===================================================================
--- branches/stable-1.2/src/core/ngx_file.c 2012-11-12 18:00:32 UTC (rev 4902)
+++ branches/stable-1.2/src/core/ngx_file.c 2012-11-12 18:39:51 UTC (rev 4903)
@@ -412,8 +412,8 @@

path = *slot;

- p = cf->cycle->pathes.elts;
- for (i = 0; i < cf->cycle->pathes.nelts; i++) {
+ p = cf->cycle->paths.elts;
+ for (i = 0; i < cf->cycle->paths.nelts; i++) {
if (p[i]->name.len == path->name.len
&& ngx_strcmp(p[i]->name.data, path->name.data) == 0)
{
@@ -457,7 +457,7 @@
}
}

- p = ngx_array_push(&cf->cycle->pathes);
+ p = ngx_array_push(&cf->cycle->paths);
if (p == NULL) {
return NGX_ERROR;
}
@@ -469,14 +469,14 @@


ngx_int_t
-ngx_create_pathes(ngx_cycle_t *cycle, ngx_uid_t user)
+ngx_create_paths(ngx_cycle_t *cycle, ngx_uid_t user)
{
ngx_err_t err;
ngx_uint_t i;
ngx_path_t **path;

- path = cycle->pathes.elts;
- for (i = 0; i < cycle->pathes.nelts; i++) {
+ path = cycle->paths.elts;
+ for (i = 0; i < cycle->paths.nelts; i++) {

if (ngx_create_dir(path[i]->name.data, 0700) == NGX_FILE_ERROR) {
err = ngx_errno;

Modified: branches/stable-1.2/src/core/ngx_file.h
===================================================================
--- branches/stable-1.2/src/core/ngx_file.h 2012-11-12 18:00:32 UTC (rev 4902)
+++ branches/stable-1.2/src/core/ngx_file.h 2012-11-12 18:39:51 UTC (rev 4903)
@@ -130,7 +130,7 @@
ngx_int_t ngx_create_path(ngx_file_t *file, ngx_path_t *path);
ngx_err_t ngx_create_full_path(u_char *dir, ngx_uint_t access);
ngx_int_t ngx_add_path(ngx_conf_t *cf, ngx_path_t **slot);
-ngx_int_t ngx_create_pathes(ngx_cycle_t *cycle, ngx_uid_t user);
+ngx_int_t ngx_create_paths(ngx_cycle_t *cycle, ngx_uid_t user);
ngx_int_t ngx_ext_rename_file(ngx_str_t *src, ngx_str_t *to,
ngx_ext_rename_file_t *ext);
ngx_int_t ngx_copy_file(u_char *from, u_char *to, ngx_copy_file_t *cf);

Modified: branches/stable-1.2/src/os/unix/ngx_process.c
===================================================================
--- branches/stable-1.2/src/os/unix/ngx_process.c 2012-11-12 18:00:32 UTC (rev 4902)
+++ branches/stable-1.2/src/os/unix/ngx_process.c 2012-11-12 18:39:51 UTC (rev 4903)
@@ -474,8 +474,6 @@
return;
}

-#if (NGX_SOLARIS || NGX_FREEBSD)
-
/*
* Solaris always calls the signal handler for each exited process
* despite waitpid() may be already called for this process.
@@ -491,8 +489,6 @@
return;
}

-#endif
-
ngx_log_error(NGX_LOG_ALERT, ngx_cycle->log, err,
"waitpid() failed");
return;

Modified: branches/stable-1.2/src/os/unix/ngx_process_cycle.c
===================================================================
--- branches/stable-1.2/src/os/unix/ngx_process_cycle.c 2012-11-12 18:00:32 UTC (rev 4902)
+++ branches/stable-1.2/src/os/unix/ngx_process_cycle.c 2012-11-12 18:39:51 UTC (rev 4903)
@@ -386,8 +386,8 @@
manager = 0;
loader = 0;

- path = ngx_cycle->pathes.elts;
- for (i = 0; i < ngx_cycle->pathes.nelts; i++) {
+ path = ngx_cycle->paths.elts;
+ for (i = 0; i < ngx_cycle->paths.nelts; i++) {

if (path[i]->manager) {
manager = 1;
@@ -1341,8 +1341,8 @@

next = 60 * 60;

- path = ngx_cycle->pathes.elts;
- for (i = 0; i < ngx_cycle->pathes.nelts; i++) {
+ path = ngx_cycle->paths.elts;
+ for (i = 0; i < ngx_cycle->paths.nelts; i++) {

if (path[i]->manager) {
n = path[i]->manager(path[i]->data);
@@ -1370,8 +1370,8 @@

cycle = (ngx_cycle_t *) ngx_cycle;

- path = cycle->pathes.elts;
- for (i = 0; i < cycle->pathes.nelts; i++) {
+ path = cycle->paths.elts;
+ for (i = 0; i < cycle->paths.nelts; i++) {

if (ngx_terminate || ngx_quit) {
break;

Modified: branches/stable-1.2/src/os/win32/ngx_process_cycle.c
===================================================================
--- branches/stable-1.2/src/os/win32/ngx_process_cycle.c 2012-11-12 18:00:32 UTC (rev 4902)
+++ branches/stable-1.2/src/os/win32/ngx_process_cycle.c 2012-11-12 18:39:51 UTC (rev 4903)
@@ -963,8 +963,8 @@

next = 60 * 60;

- path = ngx_cycle->pathes.elts;
- for (i = 0; i < ngx_cycle->pathes.nelts; i++) {
+ path = ngx_cycle->paths.elts;
+ for (i = 0; i < ngx_cycle->paths.nelts; i++) {

if (path[i]->manager) {
n = path[i]->manager(path[i]->data);
@@ -1002,8 +1002,8 @@

cycle = (ngx_cycle_t *) ngx_cycle;

- path = cycle->pathes.elts;
- for (i = 0; i < cycle->pathes.nelts; i++) {
+ path = cycle->paths.elts;
+ for (i = 0; i < cycle->paths.nelts; i++) {

if (ngx_terminate || ngx_quit) {
break;

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] svn commit: r4903 - in branches/stable-1.2: . auto misc src/core src/os/unix src/os/win32

Anonymous User 974 November 12, 2012 01:40PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 241
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready