comparison 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
comparison
equal deleted inserted replaced
255:e6938ca7331a 256:8e39cab6abd5
201 if (ccf->pid.len == 0) { 201 if (ccf->pid.len == 0) {
202 ccf->pid.len = sizeof(NGINX_PID) - 1; 202 ccf->pid.len = sizeof(NGINX_PID) - 1;
203 ccf->pid.data = NGINX_PID; 203 ccf->pid.data = NGINX_PID;
204 ccf->newpid.len = sizeof(NGINX_NEW_PID) - 1; 204 ccf->newpid.len = sizeof(NGINX_NEW_PID) - 1;
205 ccf->newpid.data = NGINX_NEW_PID; 205 ccf->newpid.data = NGINX_NEW_PID;
206
207 } else {
208 ccf->newpid.len = ccf->pid.len + sizeof(NGINX_NEW_PID_EXT);
209 if (!(ccf->newpid.data = ngx_alloc(ccf->newpid.len, cycle->log))) {
210 return 1;
211 }
212
213 ngx_memcpy(ngx_cpymem(ccf->newpid.data, ccf->pid.data, ccf->pid.len),
214 NGINX_NEW_PID_EXT, sizeof(NGINX_NEW_PID_EXT));
206 } 215 }
207 216
208 len = ngx_snprintf(pid, /* STUB */ 10, PID_T_FMT, ngx_getpid()); 217 len = ngx_snprintf(pid, /* STUB */ 10, PID_T_FMT, ngx_getpid());
209 ngx_memzero(&ctx.pid, sizeof(ngx_file_t)); 218 ngx_memzero(&ctx.pid, sizeof(ngx_file_t));
210 ctx.pid.name = ngx_inherited ? ccf->newpid : ccf->pid; 219 ctx.pid.name = ngx_inherited ? ccf->newpid : ccf->pid;
783 "invalid option: \"%s\"", ctx->argv[i]); 792 "invalid option: \"%s\"", ctx->argv[i]);
784 return NGX_ERROR; 793 return NGX_ERROR;
785 } 794 }
786 } 795 }
787 796
788 if (cycle->conf_file.len == NULL) { 797 if (cycle->conf_file.data == NULL) {
789 cycle->conf_file.len = sizeof(NGINX_CONF) - 1; 798 cycle->conf_file.len = sizeof(NGINX_CONF) - 1;
790 cycle->conf_file.data = NGINX_CONF; 799 cycle->conf_file.data = NGINX_CONF;
791 } 800 }
792 801
793 return NGX_OK; 802 return NGX_OK;
812 return NGX_ERROR; 821 return NGX_ERROR;
813 } 822 }
814 /* set by pcalloc() 823 /* set by pcalloc()
815 * 824 *
816 * ccf->pid = NULL; 825 * ccf->pid = NULL;
826 * ccf->newpid = NULL;
817 */ 827 */
818 ccf->daemon = NGX_CONF_UNSET; 828 ccf->daemon = NGX_CONF_UNSET;
819 ccf->master = NGX_CONF_UNSET; 829 ccf->master = NGX_CONF_UNSET;
820 ccf->worker_reopen = NGX_CONF_UNSET; 830 ccf->worker_reopen = NGX_CONF_UNSET;
821 ccf->user = (uid_t) NGX_CONF_UNSET; 831 ccf->user = (uid_t) NGX_CONF_UNSET;