From a83149f5ca1ea063366138eb24852e268d29955a Mon Sep 17 00:00:00 2001 From: Dirk Engling Date: Fri, 18 May 2012 08:45:32 +0000 Subject: [PATCH] Do not always grow the vector, shrink the first iovec to 0 before filling the second one --- ot_stats.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ot_stats.c b/ot_stats.c index aeb1129..b0cdf8a 100644 --- a/ot_stats.c +++ b/ot_stats.c @@ -614,8 +614,8 @@ static void stats_make( int *iovec_entries, struct iovec **iovector, ot_tasktype case TASK_STATS_SLASH24S: r += stats_slash24s_txt( r, 128 ); break; case TASK_STATS_TOP10: r += stats_top_txt( r, 10 ); break; case TASK_STATS_TOP100: - if( !( r = iovec_increase( iovec_entries, iovector, 4*OT_STATS_TMPSIZE ) ) ) - return; + r = iovec_fix_increase_or_free( iovec_entries, iovector, r, 4 * OT_STATS_TMPSIZE ); + if( !r ) return; r += stats_top_txt( r, 100 ); break; case TASK_STATS_EVERYTHING: r += stats_return_everything( r ); break; #ifdef WANT_SPOT_WOODPECKER @@ -758,4 +758,4 @@ void stats_deinit( ) { pthread_cancel( thread_id ); } -const char *g_version_stats_c = "$Source: /home/cvsroot/opentracker/ot_stats.c,v $: $Revision: 1.67 $\n"; +const char *g_version_stats_c = "$Source: /home/cvsroot/opentracker/ot_stats.c,v $: $Revision: 1.68 $\n";