Mercurial > hg
comparison mcabber/src/jab_iq.c @ 1393:216b4da93e08
Do not use struct tm's tm_gmtoff if not available
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Sun, 09 Dec 2007 19:17:42 +0100 |
parents | 74b7621537d7 |
children | d431cd75eb53 |
comparison
equal
deleted
inserted
replaced
1392:3d4963c8ce87 | 1393:216b4da93e08 |
---|---|
1572 xmlnode myquery; | 1572 xmlnode myquery; |
1573 char *buf, *utf8_buf; | 1573 char *buf, *utf8_buf; |
1574 time_t now_t; | 1574 time_t now_t; |
1575 struct tm *now; | 1575 struct tm *now; |
1576 char const *sign; | 1576 char const *sign; |
1577 int diff; | 1577 int diff = 0; |
1578 | 1578 |
1579 time(&now_t); | 1579 time(&now_t); |
1580 | 1580 |
1581 scr_LogPrint(LPRINT_LOGNORM, "Received an IQ time request from <%s>", from); | 1581 scr_LogPrint(LPRINT_LOGNORM, "Received an IQ time request from <%s>", from); |
1582 | 1582 |
1589 xmlnode_put_attrib(x, "to", xmlnode_get_attrib(xmldata, "from")); | 1589 xmlnode_put_attrib(x, "to", xmlnode_get_attrib(xmldata, "from")); |
1590 myquery = xmlnode_get_tag(x, "time"); | 1590 myquery = xmlnode_get_tag(x, "time"); |
1591 | 1591 |
1592 now = localtime(&now_t); | 1592 now = localtime(&now_t); |
1593 | 1593 |
1594 if (now->tm_isdst < 0) | 1594 if (now->tm_isdst >= 0) { |
1595 diff = 0; | 1595 #if defined HAVE_TM_GMTOFF |
1596 else | |
1597 diff = now->tm_gmtoff; | 1596 diff = now->tm_gmtoff; |
1597 #elif defined HAVE_TIMEZONE | |
1598 tzset(); | |
1599 diff = -timezone; | |
1600 #endif | |
1601 } | |
1602 | |
1598 if (diff < 0) { | 1603 if (diff < 0) { |
1599 sign = "-"; | 1604 sign = "-"; |
1600 diff = -diff; | 1605 diff = -diff; |
1601 } else { | 1606 } else { |
1602 sign = "+"; | 1607 sign = "+"; |