comparison 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
comparison
equal deleted inserted replaced
2724:9fd2f12fee0a 2725:d43d73277c5c
293 } 293 }
294 294
295 295
296 ccf = (ngx_core_conf_t *) ngx_get_conf(cycle->conf_ctx, ngx_core_module); 296 ccf = (ngx_core_conf_t *) ngx_get_conf(cycle->conf_ctx, ngx_core_module);
297 297
298 #if !(NGX_WIN32)
299
300 if (ngx_test_config) { 298 if (ngx_test_config) {
301 299
302 if (ngx_create_pidfile(&ccf->pid, log) != NGX_OK) { 300 if (ngx_create_pidfile(&ccf->pid, log) != NGX_OK) {
303 goto failed; 301 goto failed;
304 } 302 }
322 } 320 }
323 321
324 ngx_delete_pidfile(old_cycle); 322 ngx_delete_pidfile(old_cycle);
325 } 323 }
326 } 324 }
327
328 #endif
329 325
330 326
331 if (ngx_test_lockfile(cycle->lock_file.data, log) != NGX_OK) { 327 if (ngx_test_lockfile(cycle->lock_file.data, log) != NGX_OK) {
332 goto failed; 328 goto failed;
333 } 329 }
926 922
927 return NGX_OK; 923 return NGX_OK;
928 } 924 }
929 925
930 926
931 #if !(NGX_WIN32)
932
933 ngx_int_t 927 ngx_int_t
934 ngx_create_pidfile(ngx_str_t *name, ngx_log_t *log) 928 ngx_create_pidfile(ngx_str_t *name, ngx_log_t *log)
935 { 929 {
936 size_t len; 930 size_t len;
937 ngx_uint_t create; 931 ngx_uint_t create;
938 ngx_file_t file; 932 ngx_file_t file;
939 u_char pid[NGX_INT64_LEN + 2]; 933 u_char pid[NGX_INT64_LEN + 2];
940 934
935 if (ngx_process > NGX_PROCESS_MASTER) {
936 return NGX_OK;
937 }
938
941 ngx_memzero(&file, sizeof(ngx_file_t)); 939 ngx_memzero(&file, sizeof(ngx_file_t));
942 940
943 file.name = *name; 941 file.name = *name;
944 file.log = log; 942 file.log = log;
945 943
984 if (ngx_delete_file(name) == NGX_FILE_ERROR) { 982 if (ngx_delete_file(name) == NGX_FILE_ERROR) {
985 ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno, 983 ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
986 ngx_delete_file_n " \"%s\" failed", name); 984 ngx_delete_file_n " \"%s\" failed", name);
987 } 985 }
988 } 986 }
989
990 #endif
991 987
992 988
993 static ngx_int_t 989 static ngx_int_t
994 ngx_test_lockfile(u_char *file, ngx_log_t *log) 990 ngx_test_lockfile(u_char *file, ngx_log_t *log)
995 { 991 {