So much work for a one-liner. I see If I can come up with a better explanation.
On Fri, May 14, 2021 at 4:34 PM Geva, Erez <erez.geva....@siemens.com> wrote: > > Hi, > > > > I think it is better to use a short explanation how does mktime() use the > tm_isdst flag, and why should it be set to 0. > > For me the problem is that we did not comply with proper use of mktime(). > > Fixing glibc only revealed the bug in linuxptp. > > So we fix linuxptp, not trying to comply with a specific glibc! > > > > The choice of libc is up to the user, as long as it comply to the standards > (ISO C or POSIX). > > I do not see the purpose of links to bugs in glibc. > > It is also does not helps the Developers to understand, why do we need the > patch (which we do need). > > > > We are a source project, not a binary one > > > > Erez > > > > -----Original Message----- > From: Lars Munch <l...@segv.dk> > Sent: Friday, 14 May 2021 13:34 > To: linuxptp-devel@lists.sourceforge.net > Subject: [Linuxptp-devel] [PATCH 1/4] ts2phc: Fix uninitialized variable in > nmea_scan_rmc > > > > tm_isdst needs to be initialized to make sure mktime does not fail on recent > versions of glibc > > > > See: > > https://bugzilla.redhat.com/show_bug.cgi?id=1653340 > > https://sourceware.org/bugzilla/show_bug.cgi?id=24630 > > > > Signed-off-by: Lars Munch <l...@segv.dk> > > --- > > nmea.c | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git a/nmea.c b/nmea.c > > index dc865d0..44c7c01 100644 > > --- a/nmea.c > > +++ b/nmea.c > > @@ -157,6 +157,7 @@ static int nmea_scan_rmc(struct nmea_parser *np, struct > nmea_rmc *result) > > } > > tm.tm_year += 100; > > tm.tm_mon--; > > + tm.tm_isdst = 0; > > result->ts.tv_sec = mktime(&tm); > > result->ts.tv_nsec = msec * 1000000UL; > > result->fix_valid = status == 'A' ? true : false; > > -- > > 2.25.1 > > > > > > > > _______________________________________________ > > Linuxptp-devel mailing list > > Linuxptp-devel@lists.sourceforge.net > > https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.sourceforge.net%2Flists%2Flistinfo%2Flinuxptp-devel&data=04%7C01%7Cerez.geva.ext%40siemens.com%7C6bd447d3aa4a436be41808d916d024c9%7C38ae3bcd95794fd4addab42e1495d55a%7C1%7C0%7C637565905494246406%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=JgJVYnL%2BvSHUfF5H9n%2FZC0N0dwSr%2Fw2flJ5QGdZ88lI%3D&reserved=0 _______________________________________________ Linuxptp-devel mailing list Linuxptp-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxptp-devel