From: Jeff Trawick Date: Fri, 15 Mar 2002 15:16:27 +0000 (+0000) Subject: Factor out a bunch of commonality between the HAVE_TIMES path and X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fee6a0ff15052c0cd92492bd33813c44e8c30f36;p=apache Factor out a bunch of commonality between the HAVE_TIMES path and the !HAVE_TIMES path. This will help avoid future errors similar to the ones fixed earlier today. The code change also has the benefit of getting the paren-matching feature of some editors to work properly. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93954 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/generators/mod_status.c b/modules/generators/mod_status.c index e88e3db37b..13151f4d88 100644 --- a/modules/generators/mod_status.c +++ b/modules/generators/mod_status.c @@ -535,22 +535,16 @@ static int status_handler(request_rec *r) if (no_table_report) ap_rputs("

Server Details

\n\n", r); else -#ifndef HAVE_TIMES - /* Allow for OS/2 not having CPU stats */ ap_rputs("\n\n" "" - "" - "" - "" - "\n\n", r); -#else - ap_rputs("\n\n
SrvPIDAccM\nSSReqConnChildSlotClientVHostRequest
" - "" - "" + "" +#ifdef HAVE_TIMES + "" +#endif + "" "" "" "\n\n", r); -#endif } for (i = 0; i < server_limit; ++i) { @@ -633,11 +627,13 @@ static int status_handler(request_rec *r) ap_rputs("?STATE?", r); break; } -#ifndef HAVE_TIMES - /* Allow for OS/2 not having CPU stats */ - ap_rprintf(r, "]\n %ld %ld (", -#else - ap_rprintf(r, "] u%g s%g cu%g cs%g\n %ld %ld (", + + ap_rprintf(r, "] " +#ifdef HAVE_TIMES + "u%g s%g cu%g cs%g" +#endif + "\n %ld %ld (", +#ifdef HAVE_TIMES ws_record.times.tms_utime / tick, ws_record.times.tms_stime / tick, ws_record.times.tms_cutime / tick, @@ -715,12 +711,14 @@ static int status_handler(request_rec *r) ap_rputs("" +#ifdef HAVE_TIMES + "" +#endif + "
SrvPIDAccMCPU\nSSReqMCPU\nSSReqConnChildSlotClientVHostRequest
?", r); break; } - -#ifndef HAVE_TIMES - /* Allow for OS/2 not having CPU stats */ - ap_rprintf(r, "\n%ld%ld", -#else - ap_rprintf(r, "\n%.2f%ld%ld", + + ap_rprintf(r, + "\n%.2f%ld%ld", +#ifdef HAVE_TIMES (ws_record.times.tms_utime + ws_record.times.tms_stime + ws_record.times.tms_cutime + @@ -752,36 +750,24 @@ static int status_handler(request_rec *r) } /* for (i...) */ if (!(short_report || no_table_report)) { -#ifndef HAVE_TIMES ap_rputs("
\n \
\ \n \ \n \ \n \ \n \ -\n \ -\n \ -\n \ -\n \ -\n \ -\n \ -
SrvChild Server number - generation
PIDOS process ID
AccNumber of accesses this connection / this child / this slot
MMode of operation
SSSeconds since beginning of most recent request
ReqMilliseconds required to process most recent request
ConnKilobytes transferred this connection
ChildMegabytes transferred this child
SlotTotal megabytes transferred this slot
\n", r); -#else - ap_rputs("\n \ -
\ -\n \ -\n \ -\n \ -\n \ -\n \ -\n \ -\n \ +\n" + +#ifdef HAVE_TIMES +"\n" +#endif + +"\n \ \n \ \n \ \n \ \n \
SrvChild Server number - generation
PIDOS process ID
AccNumber of accesses this connection / this child / this slot
MMode of operation
CPUCPU usage, number of seconds
SSSeconds since beginning of most recent request
MMode of operation
CPUCPU usage, number of seconds
SSSeconds since beginning of most recent request
ReqMilliseconds required to process most recent request
ConnKilobytes transferred this connection
ChildMegabytes transferred this child
SlotTotal megabytes transferred this slot
\n", r); -#endif } } else {