log: Use USEC_PER_SEC instead of 1000000

Submitted by Radostin Stoyanov on Dec. 5, 2018, 9:59 a.m.

Details

Message ID 20181205095924.22939-1-rstoyanov1@gmail.com
State Accepted
Series "log: Use USEC_PER_SEC instead of 1000000"
Headers show

Commit Message

Radostin Stoyanov Dec. 5, 2018, 9:59 a.m.
Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
---
 criu/log.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/criu/log.c b/criu/log.c
index 2f5b28a6..a268ab8a 100644
--- a/criu/log.c
+++ b/criu/log.c
@@ -51,7 +51,7 @@  static void timediff(struct timeval *from, struct timeval *to)
 		to->tv_usec -= from->tv_usec;
 	else {
 		to->tv_sec--;
-		to->tv_usec += 1000000 - from->tv_usec;
+		to->tv_usec += USEC_PER_SEC - from->tv_usec;
 	}
 }
 

Comments

Andrei Vagin Dec. 8, 2018, 6:54 a.m.
Applied, thanks!

On Wed, Dec 05, 2018 at 09:59:24AM +0000, Radostin Stoyanov wrote:
> Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
> ---
>  criu/log.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/criu/log.c b/criu/log.c
> index 2f5b28a6..a268ab8a 100644
> --- a/criu/log.c
> +++ b/criu/log.c
> @@ -51,7 +51,7 @@ static void timediff(struct timeval *from, struct timeval *to)
>  		to->tv_usec -= from->tv_usec;
>  	else {
>  		to->tv_sec--;
> -		to->tv_usec += 1000000 - from->tv_usec;
> +		to->tv_usec += USEC_PER_SEC - from->tv_usec;
>  	}
>  }
>  
> -- 
> 2.19.2
> 
> _______________________________________________
> CRIU mailing list
> CRIU@openvz.org
> https://lists.openvz.org/mailman/listinfo/criu