aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRafael G. Martins <rafael@rafaelmartins.eng.br>2019-02-10 21:58:55 +0100
committerRafael G. Martins <rafael@rafaelmartins.eng.br>2019-02-10 21:59:02 +0100
commitd04bf489c8bbe190a0648f58682260d5b5cef613 (patch)
tree25e23cc1fd0bceb0a564023d42f5597d13d84ccc /src
parent74dec7c69ae961f98e0a91da9fc3f6214183467a (diff)
downloadblogc-d04bf489c8bbe190a0648f58682260d5b5cef613.tar.gz
blogc-d04bf489c8bbe190a0648f58682260d5b5cef613.tar.bz2
blogc-d04bf489c8bbe190a0648f58682260d5b5cef613.zip
blogc: rusage: added tests, fixed minor issue
Diffstat (limited to 'src')
-rw-r--r--src/blogc/rusage.c2
-rw-r--r--src/blogc/rusage.h4
2 files changed, 4 insertions, 2 deletions
diff --git a/src/blogc/rusage.c b/src/blogc/rusage.c
index 6d88dc4..a38848d 100644
--- a/src/blogc/rusage.c
+++ b/src/blogc/rusage.c
@@ -48,7 +48,7 @@ char*
blogc_rusage_format_cpu_time(long long time)
{
if (time >= 1000000)
- return bc_strdup_printf("%.3s", ((float) time) / 1000000.0);
+ return bc_strdup_printf("%.3fs", ((float) time) / 1000000.0);
// this is a special case: some systems may report the cpu time rounded up to the
// milisecond. it is useless to show ".000" in this case.
diff --git a/src/blogc/rusage.h b/src/blogc/rusage.h
index 3441630..6344066 100644
--- a/src/blogc/rusage.h
+++ b/src/blogc/rusage.h
@@ -13,9 +13,11 @@
#include <config.h>
#endif /* HAVE_CONFIG_H */
+#ifdef HAVE_SYS_TIME_H
#ifdef HAVE_SYS_RESOURCE_H
#define HAVE_RUSAGE 1
-#endif /* HAVE_SYS_RESOURCE_H */
+#endif
+#endif
#include "../common/utils.h"