diff src/core/nginx.c @ 256:8e39cab6abd5

nginx-0.0.2-2004-02-10-19:23:38 import
author Igor Sysoev <igor@sysoev.ru>
date Tue, 10 Feb 2004 16:23:38 +0000
parents e6938ca7331a
children 5238e93961a1
line wrap: on
line diff
--- a/src/core/nginx.c
+++ b/src/core/nginx.c
@@ -203,6 +203,15 @@ int main(int argc, char *const *argv, ch
         ccf->pid.data = NGINX_PID;
         ccf->newpid.len = sizeof(NGINX_NEW_PID) - 1;
         ccf->newpid.data = NGINX_NEW_PID;
+
+    } else {
+        ccf->newpid.len = ccf->pid.len + sizeof(NGINX_NEW_PID_EXT);
+        if (!(ccf->newpid.data = ngx_alloc(ccf->newpid.len, cycle->log))) {
+            return 1;
+        }
+
+        ngx_memcpy(ngx_cpymem(ccf->newpid.data, ccf->pid.data, ccf->pid.len),
+                   NGINX_NEW_PID_EXT, sizeof(NGINX_NEW_PID_EXT));
     }
 
     len = ngx_snprintf(pid, /* STUB */ 10, PID_T_FMT, ngx_getpid());
@@ -785,7 +794,7 @@ static ngx_int_t ngx_getopt(ngx_master_c
         }
     }
 
-    if (cycle->conf_file.len == NULL) {
+    if (cycle->conf_file.data == NULL) {
         cycle->conf_file.len = sizeof(NGINX_CONF) - 1;
         cycle->conf_file.data = NGINX_CONF;
     }
@@ -814,6 +823,7 @@ static ngx_int_t ngx_core_module_init(ng
     /* set by pcalloc()
      *
      * ccf->pid = NULL;
+     * ccf->newpid = NULL;
      */
     ccf->daemon = NGX_CONF_UNSET;
     ccf->master = NGX_CONF_UNSET;