public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Carlos O'Donell <carlos@redhat.com>
To: "Kacper Piwiński" <vfjpl1@gmail.com>, libc-alpha@sourceware.org
Subject: Re: [PATCH] linux: fix ntp_gettime abi break
Date: Thu, 2 Mar 2023 12:47:21 -0500	[thread overview]
Message-ID: <bbe3c77f-9c4d-422b-50ca-cf4d7bcd7781@redhat.com> (raw)
In-Reply-To: <CAKVti-BRav=mmfcQBEz_qpezmKfR_fFW9uihJb+QXiJazugTmA@mail.gmail.com>

On 2/20/23 23:04, Kacper Piwiński via Libc-alpha wrote:
> Between versions v2.11 and v2.12 struct ntptimeval got new fields.
> That wasn't a problem because new function ntp_gettimex was created
> (and made default) to support new struct. Old ntp_gettime was not
> using new fields so it was safe to call with old struct
> definition. Then between versions v2.31 and v2.32 when working on
> y2038 bugs, ntp_gettime start setting new fields.
> 
> Sets fields manually to maintain compatibility with v2.11 struct definition.

The patch fails to apply.

This fails pre-commit CI:
https://patchwork.sourceware.org/project/glibc/patch/CAKVti-BRav=mmfcQBEz_qpezmKfR_fFW9uihJb+QXiJazugTmA@mail.gmail.com/

Please have a look at:
https://sourceware.org/glibc/wiki/Contribution%20checklist

Did you generate the patch with `git format-patch`?


> 
> Author: Kacper Piwiński <vfjpl1@gmail.com>
> ---
>  sysdeps/unix/sysv/linux/ntp_gettime.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/sysdeps/unix/sysv/linux/ntp_gettime.c
> b/sysdeps/unix/sysv/linux/ntp_gettime.c
> index 4879573530..3844b2e487 100644
> --- a/sysdeps/unix/sysv/linux/ntp_gettime.c
> +++ b/sysdeps/unix/sysv/linux/ntp_gettime.c
> @@ -54,7 +54,11 @@ __ntp_gettime (struct ntptimeval *ntv)
>    int result;
> 
>    result = __ntp_gettime64 (&ntv64);
> -  *ntv = valid_ntptimeval64_to_ntptimeval (ntv64);
> +  //manually update fields to maintain abi with v2.11 struct definition
> +  struct ntptimeval tntv = valid_ntptimeval64_to_ntptimeval (ntv64);
> +  ntv->time = tntv.time;
> +  ntv->maxerror = tntv.maxerror;
> +  ntv->esterror = tntv.esterror;
> 
>    return result;
>  }
> --
> 2.38.1.windows.1
> 

-- 
Cheers,
Carlos.


  parent reply	other threads:[~2023-03-02 17:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-21  4:04 Kacper Piwiński
2023-02-21 11:24 ` Andreas Schwab
2023-02-24 15:15   ` Kacper Piwiński
2023-03-02 17:47 ` Carlos O'Donell [this message]
2023-03-03  8:47   ` Kacper Piwiński
2023-03-03 13:03     ` Adhemerval Zanella Netto
2023-03-03 16:43       ` Kacper Piwiński
2023-03-07 14:11         ` Adhemerval Zanella Netto
2023-03-08  8:58 Kacper Piwiński

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bbe3c77f-9c4d-422b-50ca-cf4d7bcd7781@redhat.com \
    --to=carlos@redhat.com \
    --cc=libc-alpha@sourceware.org \
    --cc=vfjpl1@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).