Re: [PATCH v2 1/2] ctime.3: mktime() may modify tm_hour due to tm_isdst

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

 



Hi Paul,

On 10/11/21 5:36 PM, Paul Eggert wrote:
On 10/11/21 4:12 AM, Alejandro Colomar wrote:
+If the initial value of
+.I tm_isdst
+is inconsistent with the one set by
+.BR mktime (),
+.I tm_hour
+(and possibly other fields)
+will be modified to normalize the time to the correct DST.

I don't see why this change is necessary. mktime normalizes all its input fields: there's nothing special about tm_isdst and tm_hour.

If normalization isn't explained clearly enough elsewhere in the man page, that explanation should be fixed; there shouldn't be special-case wording that implies that this is the only special case.

Hmm, you're right. I think I was misled by the wording "if structure members are outside their valid interval", which led me to think that since 08h was between 0 and 23 it shouldn´t be affected, but the normalization goes beyond that and interprets "valid range" as a more general concept so that the full time has to correspond to a valid time for a given timezone.

I'm not sure how to reword it. I'll keep it with the original text, and keep thinking about it.

Thanks,

Alex


--
Alejandro Colomar
Linux man-pages comaintainer; https://www.kernel.org/doc/man-pages/
http://www.alejandro-colomar.es/



[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux