bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH hurd] x86_64: utmp uses int32_t to store time so use a tempor


From: Samuel Thibault
Subject: Re: [PATCH hurd] x86_64: utmp uses int32_t to store time so use a temporary variable
Date: Sun, 31 Dec 2023 11:17:04 +0100
User-agent: NeoMutt/20170609 (1.8.3)

Applied, thanks!

Flavio Cruz, le sam. 30 déc. 2023 11:33:38 -0500, a ecrit:
> ---
>  utils/login.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/utils/login.c b/utils/login.c
> index 3134c4a..334941c 100644
> --- a/utils/login.c
> +++ b/utils/login.c
> @@ -157,12 +157,17 @@ static void
>  add_utmp_entry (char *args, unsigned args_len, int inherit_host)
>  {
>    struct utmp utmp;
> +  struct timeval current_time;
>    char const *host = 0;
>    long addr = 0;
>  
>    memset (&utmp, 0, sizeof(utmp));
>  
> -  gettimeofday (&utmp.ut_tv, 0);
> +  gettimeofday (&current_time, NULL);
> +  /* For x86_64, sizeof(utmp.ut_tv) != sizeof(struct timeval) */
> +  utmp.ut_tv.tv_sec = current_time.tv_sec;
> +  utmp.ut_tv.tv_usec = current_time.tv_usec;
> +
>    strncpy (utmp.ut_name, envz_get (args, args_len, "USER") ?: "",
>          sizeof (utmp.ut_name));
>  
> -- 
> 2.39.2
> 
> 

-- 
Samuel
---
Pour une évaluation indépendante, transparente et rigoureuse !
Je soutiens la Commission d'Évaluation de l'Inria.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]