]> granicus.if.org Git - apache/commitdiff
Avoid unnecessariy initialisation before we test mod_status's handler name.
authorGraham Leggett <minfrin@apache.org>
Tue, 19 Oct 2010 23:11:58 +0000 (23:11 +0000)
committerGraham Leggett <minfrin@apache.org>
Tue, 19 Oct 2010 23:11:58 +0000 (23:11 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1024462 13f79535-47bb-0310-9956-ffa450edef68

modules/generators/mod_status.c

index 0a44f02c9236cd8ac86dbaa7fdd1656540f5141c..ffb07ec8cf45c9d0d9728ea9ac6fd7be9ee77c09 100644 (file)
@@ -187,10 +187,6 @@ static int status_handler(request_rec *r)
     apr_off_t bytes, my_bytes, conn_bytes;
     apr_off_t bcount, kbcount;
     long req_time;
-#ifdef HAVE_TIMES
-    float tick;
-    int times_per_thread = getpid() != child_pid;
-#endif
     int short_report;
     int no_table_report;
     worker_score *ws_record;
@@ -199,12 +195,20 @@ static int status_handler(request_rec *r)
     pid_t *pid_buffer, worker_pid;
     clock_t tu, ts, tcu, tcs;
     ap_generation_t mpm_generation, worker_generation;
+#ifdef HAVE_TIMES
+    float tick;
+    int times_per_thread;
+#endif
 
-    if (strcmp(r->handler, STATUS_MAGIC_TYPE) &&
-        strcmp(r->handler, "server-status")) {
+    if (strcmp(r->handler, STATUS_MAGIC_TYPE) && strcmp(r->handler,
+            "server-status")) {
         return DECLINED;
     }
 
+#ifdef HAVE_TIMES
+    times_per_thread = getpid() != child_pid;
+#endif
+
     ap_mpm_query(AP_MPMQ_GENERATION, &mpm_generation);
 
 #ifdef HAVE_TIMES