comparison src/core/ngx_cycle.c @ 286:fc8dc489247e

nginx-0.0.2-2004-03-12-00:34:52 import
author Igor Sysoev <igor@sysoev.ru>
date Thu, 11 Mar 2004 21:34:52 +0000
parents 30310107dbc9
children 87e73f067470
comparison
equal deleted inserted replaced
285:8f48e6366d09 286:fc8dc489247e
224 failed = 1; 224 failed = 1;
225 } 225 }
226 } 226 }
227 } 227 }
228 228
229 #if (WIN32) 229 #if !(WIN32)
230 #if 0 230
231 /* TODO: TEST */
232 fprintf(stderr, "BEFORE\n");
233 CloseHandle(GetStdHandle(STD_ERROR_HANDLE));
234 SetStdHandle(STD_ERROR_HANDLE, cycle->log->file->fd);
235 fprintf(stderr, "AFTER\n");
236 #endif
237 #else
238 if (dup2(cycle->log->file->fd, STDERR_FILENO) == NGX_ERROR) { 231 if (dup2(cycle->log->file->fd, STDERR_FILENO) == NGX_ERROR) {
239 ngx_log_error(NGX_LOG_EMERG, log, ngx_errno, 232 ngx_log_error(NGX_LOG_EMERG, log, ngx_errno,
240 "dup2(STDERR) failed"); 233 "dup2(STDERR) failed");
241 failed = 1; 234 failed = 1;
242 } 235 }
236
243 #endif 237 #endif
244 238
245 if (failed) { 239 if (failed) {
246 240
247 /* rollback the new cycle configuration */ 241 /* rollback the new cycle configuration */
452 } 446 }
453 447
454 file[i].fd = fd; 448 file[i].fd = fd;
455 } 449 }
456 450
457 #if (WIN32) 451 #if !(WIN32)
458 /* TODO: TEST */ 452
459 CloseHandle(GetStdHandle(STD_ERROR_HANDLE));
460 SetStdHandle(STD_ERROR_HANDLE, cycle->log->file->fd);
461 #else
462 if (dup2(cycle->log->file->fd, STDERR_FILENO) == -1) { 453 if (dup2(cycle->log->file->fd, STDERR_FILENO) == -1) {
463 ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_errno, 454 ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_errno,
464 "dup2(STDERR) failed"); 455 "dup2(STDERR) failed");
465 } 456 }
457
466 #endif 458 #endif
467 } 459 }
468 460
469 461
470 static void ngx_clean_old_cycles(ngx_event_t *ev) 462 static void ngx_clean_old_cycles(ngx_event_t *ev)