• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/apache-793/httpd/support/

Lines Matching refs:status

97 static rotate_status_t status;
216 static void checkRotate(rotate_config_t *config, rotate_status_t *status)
218 if (status->current.fd == NULL) {
219 status->rotateReason = ROTATE_NEW;
225 if (apr_file_info_get(&finfo, APR_FINFO_SIZE, status->current.fd) == APR_SUCCESS) {
230 status->rotateReason = ROTATE_SIZE;
233 if (get_now(config) >= status->tLogEnd) {
234 status->rotateReason = ROTATE_TIME;
239 if (get_now(config) >= status->tLogEnd) {
240 status->rotateReason = ROTATE_TIME;
248 if (status->rotateReason != ROTATE_NONE && config->verbose) {
249 fprintf(stderr, "File rotation needed, reason: %s\n", ROTATE_REASONS[status->rotateReason]);
257 rotate_config_t *config, rotate_status_t *status)
311 if (status->current.fd) {
312 argv[2] = status->current.name;
332 * message, which must be contained in status->errbuf. The process is
334 static void truncate_and_write_error(rotate_status_t *status)
336 apr_size_t buflen = strlen(status->errbuf);
338 if (apr_file_trunc(status->current.fd, 0) != APR_SUCCESS) {
339 fprintf(stderr, "Error truncating the file %s\n", status->current.name);
342 if (apr_file_write_full(status->current.fd, status->errbuf, buflen, NULL) != APR_SUCCESS) {
344 status->errbuf, status->current.name);
360 static void doRotate(rotate_config_t *config, rotate_status_t *status)
369 status->rotateReason = ROTATE_NONE;
380 if (tLogStart < status->tLogEnd) {
383 status->tLogEnd = tLogEnd;
402 if (status->fileNum == -1 || status->fileNum == (config->num_files - 1)) {
407 thisLogNum = status->fileNum + 1;
416 apr_pool_create(&newlog.pool, status->pool);
421 | (config->truncate || (config->num_files > 0 && status->current.fd) ? APR_TRUNCATE : 0),
425 post_rotate(newlog.pool, &newlog, config, status);
427 status->fileNum = thisLogNum;
429 if (status->current.fd) {
430 close_logfile(config, &status->current);
434 status->current = newlog;
444 if (status->current.fd == NULL) {
454 apr_snprintf(status->errbuf, sizeof status->errbuf,
457 status->nMessCount, error);
459 truncate_and_write_error(status);
462 status->nMessCount = 0;
541 memset(&status, 0, sizeof status);
542 status.rotateReason = ROTATE_NONE;
544 apr_pool_create(&status.pool, NULL);
545 apr_getopt_init(&opt, status.pool, argc, argv);
580 status.fileNum = -1;
615 if (status.fileNum == -1 && config.num_files < 1) {
620 if (apr_file_open_stdin(&f_stdin, status.pool) != APR_SUCCESS) {
625 if (apr_file_open_stdout(&f_stdout, status.pool) != APR_SUCCESS) {
639 pollfd.p = status.pool;
651 doRotate(&config, &status);
658 polltimeout = status.tLogEnd ? status.tLogEnd - get_now(&config) : config.tRotation;
692 checkRotate(&config, &status);
693 if (status.rotateReason != ROTATE_NONE) {
694 doRotate(&config, &status);
698 rv = apr_file_write_full(status.current.fd, buf, nWrite, &nWrite);
703 if (apr_file_seek(status.current.fd, APR_CUR, &cur_offset) != APR_SUCCESS) {
706 status.nMessCount++;
707 apr_snprintf(status.errbuf, sizeof status.errbuf,
710 rv, cur_offset, status.nMessCount, &rv);
712 truncate_and_write_error(&status);
715 status.nMessCount++;