diff src/core/ngx_cycle.c @ 2725:d43d73277c5c

Win32 master/workers model
author Igor Sysoev <igor@sysoev.ru>
date Mon, 20 Apr 2009 06:08:47 +0000
parents ffa8e2451457
children 218b8949f2fd
line wrap: on
line diff
--- a/src/core/ngx_cycle.c
+++ b/src/core/ngx_cycle.c
@@ -295,8 +295,6 @@ ngx_init_cycle(ngx_cycle_t *old_cycle)
 
     ccf = (ngx_core_conf_t *) ngx_get_conf(cycle->conf_ctx, ngx_core_module);
 
-#if !(NGX_WIN32)
-
     if (ngx_test_config) {
 
         if (ngx_create_pidfile(&ccf->pid, log) != NGX_OK) {
@@ -325,8 +323,6 @@ ngx_init_cycle(ngx_cycle_t *old_cycle)
         }
     }
 
-#endif
-
 
     if (ngx_test_lockfile(cycle->lock_file.data, log) != NGX_OK) {
         goto failed;
@@ -928,8 +924,6 @@ ngx_init_zone_pool(ngx_cycle_t *cycle, n
 }
 
 
-#if !(NGX_WIN32)
-
 ngx_int_t
 ngx_create_pidfile(ngx_str_t *name, ngx_log_t *log)
 {
@@ -938,6 +932,10 @@ ngx_create_pidfile(ngx_str_t *name, ngx_
     ngx_file_t  file;
     u_char      pid[NGX_INT64_LEN + 2];
 
+    if (ngx_process > NGX_PROCESS_MASTER) {
+        return NGX_OK;
+    }
+
     ngx_memzero(&file, sizeof(ngx_file_t));
 
     file.name = *name;
@@ -987,8 +985,6 @@ ngx_delete_pidfile(ngx_cycle_t *cycle)
     }
 }
 
-#endif
-
 
 static ngx_int_t
 ngx_test_lockfile(u_char *file, ngx_log_t *log)