From 7a481ed8681c13d2068797db091f9ff7ff8bf85d Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Thu, 15 Feb 2001 19:22:02 +0000 Subject: [PATCH] Fix the seg fault in mod_status.c. This changes the up_time to an interval_time. The segfault is caused by apr_vformatter not understanding %lld, so we also had to change that to %qd, which solves that problem. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88176 13f79535-47bb-0310-9956-ffa450edef68 --- modules/generators/mod_status.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/generators/mod_status.c b/modules/generators/mod_status.c index 825177110e..546dc0cca6 100644 --- a/modules/generators/mod_status.c +++ b/modules/generators/mod_status.c @@ -182,7 +182,7 @@ static void format_kbyte_out(request_rec *r, unsigned long kbytes) ap_rprintf(r, "%.1f GB", (float) kbytes / MBYTE); } -static void show_time(request_rec *r, apr_time_t tsecs) +static void show_time(request_rec *r, apr_interval_time_t tsecs) { apr_time_t days, hrs, mins, secs; @@ -193,13 +193,13 @@ static void show_time(request_rec *r, apr_time_t tsecs) hrs = tsecs % 24; days = tsecs / 24; if (days) - ap_rprintf(r, " %lld day%s", days, days == 1 ? "" : "s"); + ap_rprintf(r, " %qd day%s", days, days == 1 ? "" : "s"); if (hrs) - ap_rprintf(r, " %lld hour%s", hrs, hrs == 1 ? "" : "s"); + ap_rprintf(r, " %qd hour%s", hrs, hrs == 1 ? "" : "s"); if (mins) - ap_rprintf(r, " %lld minute%s", mins, mins == 1 ? "" : "s"); + ap_rprintf(r, " %qd minute%s", mins, mins == 1 ? "" : "s"); if (secs) - ap_rprintf(r, " %lld second%s", secs, secs == 1 ? "" : "s"); + ap_rprintf(r, " %qd second%s", secs, secs == 1 ? "" : "s"); } /* Main handler for x-httpd-status requests */ @@ -231,7 +231,7 @@ static int status_handler(request_rec *r) { const char *loc; apr_time_t nowtime = apr_time_now(); - apr_time_t up_time; + apr_interval_time_t up_time; int j, i, res; int ready = 0; int busy = 0; -- 2.40.0