summaryrefslogtreecommitdiffstats
path: root/runtime/stat-common.c
diff options
context:
space:
mode:
authorhunt <hunt>2005-09-09 09:12:37 +0000
committerhunt <hunt>2005-09-09 09:12:37 +0000
commit1431278aba3347fdb55ec461008a07d9010aea7a (patch)
treeb11b30f9c1d46ae1f2ab75a4bd529463f71be79f /runtime/stat-common.c
parent60a1b0ceedecf422af6b043186092986685efb59 (diff)
downloadsystemtap-steved-1431278aba3347fdb55ec461008a07d9010aea7a.tar.gz
systemtap-steved-1431278aba3347fdb55ec461008a07d9010aea7a.tar.xz
systemtap-steved-1431278aba3347fdb55ec461008a07d9010aea7a.zip
2005-09-09 Martin Hunt <hunt@redhat.com>
* stat-common.c (_stp_stat_print_valtype): Use _stp_div64(). * arith.c (_stp_div64): Check error before writing to it. Remove check against 32-bit LONG_MIN and -1. That only applies to 64-bit. (_stp_mod64): Ditto.
Diffstat (limited to 'runtime/stat-common.c')
-rw-r--r--runtime/stat-common.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/runtime/stat-common.c b/runtime/stat-common.c
index ff19662b..55f2ad38 100644
--- a/runtime/stat-common.c
+++ b/runtime/stat-common.c
@@ -173,10 +173,8 @@ static void _stp_stat_print_valtype (char *fmt, Stat st, struct stat_data *sd, i
case 'A':
{
int64_t avg = 0;
- if (sd->count) {
- avg = sd->sum;
- do_div (avg, (int)sd->count); /* FIXME: check for overflow */
- }
+ if (sd->count)
+ avg = _stp_div64 (NULL, sd->sum, sd->count);
_stp_printf("%lld", avg);
break;
}