tech-userlevel archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: [PATCH 1/6] fix ambiguous errno treating after mktime()
On Fri, Aug 22, 2008 at 09:26:01AM +0300, Andy Shevchenko wrote:
> int main()
> {
> time_t rc;
> struct tm tms;
>
> memset(&tms, 0, sizeof(tms));
> tms.tm_year = ~0;
>
> errno = 0;
> rc = mktime(&tms);
>
> if (errno != 0)
> printf("mktime(): errno was %d\n", errno);
>
> return 0;
> }
What happens here is the internal tzset() call as part of mktime sets
errno. Given that this is not documented as side effect of tzset, I am
consider to save and restore errno in tzset_locked and friends.
Opinions?
Joerg
Home |
Main Index |
Thread Index |
Old Index