From f806b3a20e01b79c06f34e82bc83c5c7cbe2d9b4 Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Fri, 2 Feb 2001 19:28:06 +0000 Subject: [PATCH] Should consider APRizing the entire module. For now, use HAVE_TIMES to indicate if we have the necessary structures. This is part of getting mod_status working on Windows git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87958 13f79535-47bb-0310-9956-ffa450edef68 --- modules/generators/mod_status.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/modules/generators/mod_status.c b/modules/generators/mod_status.c index a01af0dbcd..64314bd542 100644 --- a/modules/generators/mod_status.c +++ b/modules/generators/mod_status.c @@ -237,7 +237,7 @@ static int status_handler(request_rec *r) unsigned long bcount = 0; unsigned long kbcount = 0; long req_time; -#ifndef NO_TIMES +#ifdef HAVE_TIMES #ifdef _SC_CLK_TCK float tick = sysconf(_SC_CLK_TCK); #else @@ -326,12 +326,12 @@ static int status_handler(request_rec *r) lres = score_record.access_count; bytes = score_record.bytes_served; if (lres != 0 || (res != SERVER_READY && res != SERVER_DEAD)) { -#ifndef NO_TIMES +#ifdef HAVE_TIMES tu += score_record.times.tms_utime; ts += score_record.times.tms_stime; tcu += score_record.times.tms_cutime; tcs += score_record.times.tms_cstime; -#endif /* NO_TIMES */ +#endif /* HAVE_TIMES */ count += lres; bcount += bytes; if (bcount >= KBYTE) { @@ -371,7 +371,7 @@ static int status_handler(request_rec *r) ap_rprintf(r, "Total Accesses: %lu\nTotal kBytes: %lu\n", count, kbcount); -#ifndef NO_TIMES +#ifdef HAVE_TIMES /* Allow for OS/2 not having CPU stats */ if (ts || tu || tcu || tcs) ap_rprintf(r, "CPULoad: %g\n", @@ -395,7 +395,7 @@ static int status_handler(request_rec *r) ap_rprintf(r, "Total accesses: %lu - Total Traffic: ", count); format_kbyte_out(r, kbcount); -#ifndef NO_TIMES +#ifdef HAVE_TIMES /* Allow for OS/2 not having CPU stats */ ap_rputs("
\n", r); ap_rprintf(r, "CPU Usage: u%g s%g cu%g cs%g", @@ -493,7 +493,7 @@ static int status_handler(request_rec *r) if (no_table_report) ap_rputs("


Server Details

\n\n", r); else -#ifdef NO_TIMES +#ifndef HAVE_TIMES /* Allow for OS/2 not having CPU stats */ ap_rputs("

\n\n\n\n", r); #else @@ -510,17 +510,18 @@ static int status_handler(request_rec *r) vhost = NULL; } + #if defined(NO_GETTIMEOFDAY) -#ifndef NO_TIMES +#ifdef HAVE_TIMES if (score_record.start_time == (clock_t) 0) -#endif /* NO_TIMES */ +#endif /* HAVE_TIMES */ req_time = 0L; -#ifndef NO_TIMES +#ifdef HAVE_TIMES else { req_time = score_record.stop_time - score_record.start_time; req_time = (req_time * 1000) / (int) tick; } -#endif /* NO_TIMES */ +#endif /* HAVE_TIMES */ #else if (score_record.start_time == 0L && score_record.start_time == 0L) @@ -587,7 +588,7 @@ static int status_handler(request_rec *r) ap_rputs("?STATE?", r); break; } -#ifdef NO_TIMES +#ifndef HAVE_TIMES /* Allow for OS/2 not having CPU stats */ ap_rprintf(r, "]\n %.0f %ld (", #else @@ -661,7 +662,7 @@ static int status_handler(request_rec *r) ap_rputs("
SrvPIDAccM\nSSReqConnChildSlotClientVHostRequest
?", r); break; } -#ifdef NO_TIMES +#ifndef HAVE_TIMES /* Allow for OS/2 not having CPU stats */ ap_rprintf(r, "\n%.0f%ld", #else @@ -697,7 +698,7 @@ static int status_handler(request_rec *r) } if (!(short_report || no_table_report)) { -#ifdef NO_TIMES +#ifndef HAVE_TIMES ap_rputs("
\n \


\ \n \ -- 2.50.1