1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

dtcm: resolve mismatch between tm.tm_gmtoff and global timezone

`timezone` and `tm.tm_gmtoff` represent reversed sign value each other.
Change `tm.tm_gmtoff` usage to be matched with `timezone`.
This commit is contained in:
OBATA Akio 2021-10-17 12:19:52 +09:00
parent 224f04cb29
commit fb91c9416d
3 changed files with 3 additions and 3 deletions

View file

@ -531,7 +531,7 @@ time_t cm_getdate(char *p, struct timeb *now)
lt = localtime(&tod);
now->time = lt->tm_sec;
#ifdef __OpenBSD__
now->timezone = lt->tm_gmtoff / 60;
now->timezone = - lt->tm_gmtoff / 60;
#else
now->timezone = timezone/60;
#endif

View file

@ -986,7 +986,7 @@ gmt_off(void)
t = now();
tm = *_XLocaltime(&t, localtime_buf);
gmt = tm.tm_gmtoff;
gmt = - tm.tm_gmtoff;
#endif /* SVR4 */
return(gmt);
}

View file

@ -1423,7 +1423,7 @@ _DtCm_rtable_gmtoff_4_svc(void *args, struct svc_req *svcrq)
#if defined(CSRG_BASED)
ctime = time(NULL);
t = localtime(&ctime);
gmtoff = t->tm_gmtoff;
gmtoff = - t->tm_gmtoff;
#else
gmtoff = timezone;
#endif