[systemd-devel] [PATCH v2] bootchart: use NSEC_PER_SEC

Lennart Poettering lennart at poettering.net
Mon Aug 18 12:02:29 PDT 2014


On Mon, 18.08.14 20:59, Ronny Chevalier (chevalier.ronny at gmail.com) wrote:

Thanks! Applied!

> ---
>  src/bootchart/store.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/src/bootchart/store.c b/src/bootchart/store.c
> index cedcba8..2d2ea42 100644
> --- a/src/bootchart/store.c
> +++ b/src/bootchart/store.c
> @@ -34,6 +34,7 @@
>  #include <time.h>
>  
>  #include "util.h"
> +#include "time-util.h"
>  #include "strxcpyx.h"
>  #include "store.h"
>  #include "bootchart.h"
> @@ -54,14 +55,14 @@ double gettime_ns(void) {
>  
>          clock_gettime(CLOCK_MONOTONIC, &n);
>  
> -        return (n.tv_sec + (n.tv_nsec / 1000000000.0));
> +        return (n.tv_sec + (n.tv_nsec / (double) NSEC_PER_SEC));
>  }
>  
>  static double gettime_up(void) {
>          struct timespec n;
>  
>          clock_gettime(CLOCK_BOOTTIME, &n);
> -        return (n.tv_sec + (n.tv_nsec / 1000000000.0));
> +        return (n.tv_sec + (n.tv_nsec / (double) NSEC_PER_SEC));
>  }
>  
>  void log_uptime(void) {


Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list