634 * of time is variable, depending on system load, etc.
635 * so we want to allow a little "slop" in the value of
636 * "when". this way, if a log should be rotated every
637 * week, and the number of seconds passed is really a
638 * few seconds short of a week, we'll go ahead and
639 * rotate the log as expected.
640 *
641 */
642 if (when >= 60 * 60)
643 when -= 59;
644
645 /*
646 * last rotation is recorded as argument to -P,
647 * but if logname isn't the same as log file name
648 * then the timestamp would be recorded on a
649 * separate line in the conf file. so if we
650 * haven't seen a -P already, we check to see if
651 * it is part of a specific entry for the log
652 * file name. this handles the case where the
653 * logname is "apache", it supplies a log file
654 * name like "/var/apache/logs/[a-z]*_log",
655 * which expands to multiple file names. if one
656 * of the file names is "/var/apache/logs/access_log"
657 * the the -P will be attached to a line with that
658 * logname in the conf file.
659 */
660 if (opts_count(opts, "P")) {
661 off_t last = opts_optarg_int(opts, "P");
662
663 /* return if not enough time has passed */
664 if (Now - last < when)
665 return (B_TRUE);
666 } else if ((cfopts = conf_opts(fname)) != NULL &&
667 opts_count(cfopts, "P")) {
668 off_t last = opts_optarg_int(cfopts, "P");
669
670 /*
671 * just checking this means this entry
672 * is now "done" if we're going through
673 * the entire conffile
674 */
675 Donenames = lut_add(Donenames, fname, "1");
676
677 /* return if not enough time has passed */
|
634 * of time is variable, depending on system load, etc.
635 * so we want to allow a little "slop" in the value of
636 * "when". this way, if a log should be rotated every
637 * week, and the number of seconds passed is really a
638 * few seconds short of a week, we'll go ahead and
639 * rotate the log as expected.
640 *
641 */
642 if (when >= 60 * 60)
643 when -= 59;
644
645 /*
646 * last rotation is recorded as argument to -P,
647 * but if logname isn't the same as log file name
648 * then the timestamp would be recorded on a
649 * separate line in the conf file. so if we
650 * haven't seen a -P already, we check to see if
651 * it is part of a specific entry for the log
652 * file name. this handles the case where the
653 * logname is "apache", it supplies a log file
654 * name like "/var/apache2/2.2/logs/[a-z]*_log",
655 * which expands to multiple file names. if one of
656 * the file names is "/var/apache2/2.2/logs/access_log"
657 * then the -P will be attached to a line with that
658 * logname in the conf file.
659 */
660 if (opts_count(opts, "P")) {
661 off_t last = opts_optarg_int(opts, "P");
662
663 /* return if not enough time has passed */
664 if (Now - last < when)
665 return (B_TRUE);
666 } else if ((cfopts = conf_opts(fname)) != NULL &&
667 opts_count(cfopts, "P")) {
668 off_t last = opts_optarg_int(cfopts, "P");
669
670 /*
671 * just checking this means this entry
672 * is now "done" if we're going through
673 * the entire conffile
674 */
675 Donenames = lut_add(Donenames, fname, "1");
676
677 /* return if not enough time has passed */
|