Re: git: 676041c41ba5 - main - WPA: Allow CLOCK_BOOTTIME and CLOCK_MONOTONIC to #define the same

From: Cy Schubert <Cy.Schubert_at_cschubert.com>
Date: Fri, 31 May 2024 16:00:12 UTC
In message <CANCZdfpyhd=BAcF_YFCCTumYNpGUMs0bQandZnoTYjFWcM7hqg@mail.gmail.c
om>
, Warner Losh writes:
> --00000000000056c22d0619c1eb4c
> Content-Type: text/plain; charset="UTF-8"
> Content-Transfer-Encoding: quoted-printable
>
> On Fri, May 31, 2024 at 11:28=E2=80=AFAM Cy Schubert <Cy.Schubert@cschubert=
> .com>
> wrote:
>
> > In message <202405311447.44VEl06w078151@gitrepo.freebsd.org>, Warner Losh
> > write
> > s:
> > > The branch main has been updated by imp:
> > >
> > > URL:
> > https://cgit.FreeBSD.org/src/commit/?id=3D676041c41ba587285bb934aa2fca290=
> e
> > > a7208038
> > >
> > > commit 676041c41ba587285bb934aa2fca290ea7208038
> > > Author:     Warner Losh <imp@FreeBSD.org>
> > > AuthorDate: 2024-05-31 14:44:55 +0000
> > > Commit:     Warner Losh <imp@FreeBSD.org>
> > > CommitDate: 2024-05-31 14:44:55 +0000
> > >
> > >     WPA: Allow CLOCK_BOOTTIME and CLOCK_MONOTONIC to #define the same
> > >
> > >     Historically, these have been differnet values, and only one was
> > defined
> > >     or they were defined as different values. Now that they are about t=
> o
> > be
> > >     the same value, add #ifdef to cope.
> > >
> > >     Sponsored by:           Netflix
> > >     Reviewed by:            olce, val_packett.cool, adrian
> > >     Differential Revision:  https://reviews.freebsd.org/D45418
> > > ---
> > >  contrib/wpa/src/utils/os_unix.c | 11 ++++++++---
> > >  1 file changed, 8 insertions(+), 3 deletions(-)
> > >
> > > diff --git a/contrib/wpa/src/utils/os_unix.c
> > b/contrib/wpa/src/utils/os_unix.
> > > c
> > > index 315c973f3228..a856179fb3b1 100644
> > > --- a/contrib/wpa/src/utils/os_unix.c
> > > +++ b/contrib/wpa/src/utils/os_unix.c
> > > @@ -72,7 +72,6 @@ int os_get_time(struct os_time *t)
> > >       return res;
> > >  }
> > >
> > > -
> > >  int os_get_reltime(struct os_reltime *t)
> > >  {
> > >  #ifndef __MACH__
> > > @@ -97,15 +96,21 @@ int os_get_reltime(struct os_reltime *t)
> > >                       return 0;
> > >               }
> > >               switch (clock_id) {
> > > -#ifdef CLOCK_BOOTTIME
> > > +#if defined(CLOCK_BOOTTIME)
> >
> > Why this change? This could become a potential merge conflict next time
> > WPA
> > is MFVed.
> >
>
> Oh, that was a mistake.
>
>
> > >               case CLOCK_BOOTTIME:
> > >                       clock_id =3D CLOCK_MONOTONIC;
> > >                       break;
> > >  #endif
> > > -#ifdef CLOCK_MONOTONIC
> > > +#if defined(CLOCK_MONOTONIC)
> >
> > Ditto.
> >
>
> Ditto. I iterated on these changes and thought I'd restored them to the
> original. I'll do a followup diff minimization diff.
>
> >
> > > +/*
> > > + * FreeBSD has both BOOTTIME and MONOTONIC defined to the same value,
> > since
> > > they
> > > + * mean the same thing. FreeBSD 14.1 and ealier don't, so need this
> > case.
> > > + */
> > > +#if !(defined(CLOCK_BOOTTIME) && CLOCK_BOOTTIME =3D=3D CLOCK_MONOTONIC=
> )
> >
> > This I probably want to apply to the ports.
> >
>
> Yes. I had you on the review, but I did move kinda quickly on this, and so

That was my fault. My MH review folder is large and with all the things 
going on here I failed to cherry-pick this one out of that folder. This is 
totally on me, I'm sorry.

> those ports
> are likely broken by the change in FreeBSD. My apologies.

No apologies necessary. As long as I know what can be kept and what can be 
overwritten next time WPA is MFVed.


-- 
Cheers,
Cy Schubert <Cy.Schubert@cschubert.com>
FreeBSD UNIX:  <cy@FreeBSD.org>   Web:  https://FreeBSD.org
NTP:           <cy@nwtime.org>    Web:  https://nwtime.org

			e^(i*pi)+1=0