From: Greg Ames Date: Tue, 10 Jul 2001 22:50:54 +0000 (+0000) Subject: fix pid numbers in mod_status output when using a threaded mpm. pid_buffer was X-Git-Tag: 2.0.21~69 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=537f07df5e9e9139cb8b608fcc70164985e647d8;p=apache fix pid numbers in mod_status output when using a threaded mpm. pid_buffer was being indexed by worker slot during initialization, then by process slot when generating output. This saves a little storage and a few cycles, too. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89534 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/generators/mod_status.c b/modules/generators/mod_status.c index e00cffc41e..42843fc699 100644 --- a/modules/generators/mod_status.c +++ b/modules/generators/mod_status.c @@ -254,7 +254,7 @@ static int status_handler(request_rec *r) worker_score ws_record; process_score ps_record; char stat_buffer[HARD_SERVER_LIMIT * HARD_THREAD_LIMIT]; - pid_t pid_buffer[HARD_SERVER_LIMIT * HARD_THREAD_LIMIT]; + pid_t pid_buffer[HARD_SERVER_LIMIT]; clock_t tu, ts, tcu, tcs; server_rec *vhost; @@ -321,7 +321,6 @@ static int status_handler(request_rec *r) ps_record = ap_scoreboard_image->parent[i]; res = ws_record.status; stat_buffer[indx] = status_flags[res]; - pid_buffer[indx] = ps_record.pid; if (res == SERVER_READY) ready++; else if (res != SERVER_DEAD && res != SERVER_IDLE_KILL) @@ -345,6 +344,7 @@ static int status_handler(request_rec *r) } } } + pid_buffer[i] = ps_record.pid; } /* up_time in seconds */