Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 31 May 2024 11:48:36 -0400
From:      Warner Losh <imp@bsdimp.com>
To:        Cy Schubert <Cy.Schubert@cschubert.com>
Cc:        Warner Losh <imp@freebsd.org>, src-committers@freebsd.org,  dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org
Subject:   Re: git: 676041c41ba5 - main - WPA: Allow CLOCK_BOOTTIME and CLOCK_MONOTONIC to #define the same
Message-ID:  <CANCZdfpyhd=BAcF_YFCCTumYNpGUMs0bQandZnoTYjFWcM7hqg@mail.gmail.com>
In-Reply-To: <20240531152819.33B6597@slippy.cwsent.com>
References:  <202405311447.44VEl06w078151@gitrepo.freebsd.org> <20240531152819.33B6597@slippy.cwsent.com>

next in thread | previous in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
On Fri, May 31, 2024 at 11:28 AM 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=676041c41ba587285bb934aa2fca290e
> > 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 to
> 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 = 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 == 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
those ports
are likely broken by the change in FreeBSD. My apologies.

Warner


> >               case CLOCK_MONOTONIC:
> >                       clock_id = CLOCK_REALTIME;
> >                       break;
> > +#endif
> >  #endif
> >               case CLOCK_REALTIME:
> >                       return -1;
> >
>
>
> --
> 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
>
>
>

[-- Attachment #2 --]
<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, May 31, 2024 at 11:28 AM Cy Schubert &lt;<a href="mailto:Cy.Schubert@cschubert.com">Cy.Schubert@cschubert.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">In message &lt;<a href="mailto:202405311447.44VEl06w078151@gitrepo.freebsd.org" target="_blank">202405311447.44VEl06w078151@gitrepo.freebsd.org</a>&gt;, Warner Losh <br>
write<br>
s:<br>
&gt; The branch main has been updated by imp:<br>
&gt;<br>
&gt; URL: <a href="https://cgit.FreeBSD.org/src/commit/?id=676041c41ba587285bb934aa2fca290e" rel="noreferrer" target="_blank">https://cgit.FreeBSD.org/src/commit/?id=676041c41ba587285bb934aa2fca290e</a><br>;
&gt; a7208038<br>
&gt;<br>
&gt; commit 676041c41ba587285bb934aa2fca290ea7208038<br>
&gt; Author:     Warner Losh &lt;imp@FreeBSD.org&gt;<br>
&gt; AuthorDate: 2024-05-31 14:44:55 +0000<br>
&gt; Commit:     Warner Losh &lt;imp@FreeBSD.org&gt;<br>
&gt; CommitDate: 2024-05-31 14:44:55 +0000<br>
&gt;<br>
&gt;     WPA: Allow CLOCK_BOOTTIME and CLOCK_MONOTONIC to #define the same<br>
&gt;     <br>
&gt;     Historically, these have been differnet values, and only one was defined<br>
&gt;     or they were defined as different values. Now that they are about to be<br>
&gt;     the same value, add #ifdef to cope.<br>
&gt;     <br>
&gt;     Sponsored by:           Netflix<br>
&gt;     Reviewed by:            olce, val_packett.cool, adrian<br>
&gt;     Differential Revision:  <a href="https://reviews.freebsd.org/D45418" rel="noreferrer" target="_blank">https://reviews.freebsd.org/D45418</a><br>;
&gt; ---<br>
&gt;  contrib/wpa/src/utils/os_unix.c | 11 ++++++++---<br>
&gt;  1 file changed, 8 insertions(+), 3 deletions(-)<br>
&gt;<br>
&gt; diff --git a/contrib/wpa/src/utils/os_unix.c b/contrib/wpa/src/utils/os_unix.<br>
&gt; c<br>
&gt; index 315c973f3228..a856179fb3b1 100644<br>
&gt; --- a/contrib/wpa/src/utils/os_unix.c<br>
&gt; +++ b/contrib/wpa/src/utils/os_unix.c<br>
&gt; @@ -72,7 +72,6 @@ int os_get_time(struct os_time *t)<br>
&gt;       return res;<br>
&gt;  }<br>
&gt;  <br>
&gt; -<br>
&gt;  int os_get_reltime(struct os_reltime *t)<br>
&gt;  {<br>
&gt;  #ifndef __MACH__<br>
&gt; @@ -97,15 +96,21 @@ int os_get_reltime(struct os_reltime *t)<br>
&gt;                       return 0;<br>
&gt;               }<br>
&gt;               switch (clock_id) {<br>
&gt; -#ifdef CLOCK_BOOTTIME<br>
&gt; +#if defined(CLOCK_BOOTTIME)<br>
<br>
Why this change? This could become a potential merge conflict next time WPA <br>
is MFVed.<br></blockquote><div><br></div><div>Oh, that was a mistake. </div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
&gt;               case CLOCK_BOOTTIME:<br>
&gt;                       clock_id = CLOCK_MONOTONIC;<br>
&gt;                       break;<br>
&gt;  #endif<br>
&gt; -#ifdef CLOCK_MONOTONIC<br>
&gt; +#if defined(CLOCK_MONOTONIC)<br>
<br>
Ditto.<br></blockquote><div><br></div><div>Ditto. I iterated on these changes and thought I&#39;d restored them to the original. I&#39;ll do a followup diff minimization diff. </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
&gt; +/*<br>
&gt; + * FreeBSD has both BOOTTIME and MONOTONIC defined to the same value, since <br>
&gt; they<br>
&gt; + * mean the same thing. FreeBSD 14.1 and ealier don&#39;t, so need this case.<br>
&gt; + */<br>
&gt; +#if !(defined(CLOCK_BOOTTIME) &amp;&amp; CLOCK_BOOTTIME == CLOCK_MONOTONIC)<br>
<br>
This I probably want to apply to the ports.<br></blockquote><div><br></div><div>Yes. I had you on the review, but I did move kinda quickly on this, and so those ports</div><div>are likely broken by the change in FreeBSD. My apologies.</div><div><br></div><div>Warner</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
&gt;               case CLOCK_MONOTONIC:<br>
&gt;                       clock_id = CLOCK_REALTIME;<br>
&gt;                       break;<br>
&gt; +#endif<br>
&gt;  #endif<br>
&gt;               case CLOCK_REALTIME:<br>
&gt;                       return -1;<br>
&gt;<br>
<br>
<br>
-- <br>
Cheers,<br>
Cy Schubert &lt;<a href="mailto:Cy.Schubert@cschubert.com" target="_blank">Cy.Schubert@cschubert.com</a>&gt;<br>
FreeBSD UNIX:  &lt;cy@FreeBSD.org&gt;   Web:  <a href="https://FreeBSD.org" rel="noreferrer" target="_blank">https://FreeBSD.org</a><br>;
NTP:           &lt;<a href="mailto:cy@nwtime.org" target="_blank">cy@nwtime.org</a>&gt;    Web:  <a href="https://nwtime.org" rel="noreferrer" target="_blank">https://nwtime.org</a><br>;
<br>
                        e^(i*pi)+1=0<br>
<br>
<br>
</blockquote></div></div>

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfpyhd=BAcF_YFCCTumYNpGUMs0bQandZnoTYjFWcM7hqg>