diff options
Diffstat (limited to 'xlators/debug/io-stats')
-rw-r--r-- | xlators/debug/io-stats/src/io-stats.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/xlators/debug/io-stats/src/io-stats.c b/xlators/debug/io-stats/src/io-stats.c index 912c78e69c4..556c7224960 100644 --- a/xlators/debug/io-stats/src/io-stats.c +++ b/xlators/debug/io-stats/src/io-stats.c @@ -1087,9 +1087,10 @@ io_stats_dump_stats_to_dict (xlator_t *this, dict_t *resp, gf_time_fmt (timestr, sizeof timestr, conf->cumulative.max_openfd_time.tv_sec, gf_timefmt_FT); - snprintf (timestr + strlen (timestr), sizeof timestr - strlen (timestr), - ".%"GF_PRI_SUSECONDS, - conf->cumulative.max_openfd_time.tv_usec); + if (conf->cumulative.max_openfd_time.tv_sec) + snprintf (timestr + strlen (timestr), sizeof timestr - strlen (timestr), + ".%"GF_PRI_SUSECONDS, + conf->cumulative.max_openfd_time.tv_usec); dict_timestr = gf_strdup (timestr); if (!dict_timestr) |