Browse Source

Merge branch 'Release_3.1' - patch for ENGINE-951

IPS-2
Krista Bennett 12 months ago
parent
commit
eb3b2fc65c
1 changed files with 16 additions and 15 deletions
  1. +16
    -15
      src/timestamp.c

+ 16
- 15
src/timestamp.c View File

@ -15,23 +15,24 @@
DYNAMIC_API time_t timegm_with_gmtoff(const timestamp* ts)
{
if (!ts)
return -1;
timestamp *_ts = timestamp_dup(ts);
if (!_ts)
return -1;
const time_t raw_time = timegm(_ts);
if(raw_time==-1)
return -1;
free_timestamp(_ts);
return raw_time - ts->tm_gmtoff;
time_t retval = -1;
timestamp *_ts = NULL;
if (ts) {
_ts = timestamp_dup(ts);
if (_ts) {
const time_t raw_time = timegm(_ts);
if (raw_time != -1) {
retval = raw_time - ts->tm_gmtoff;
}
}
}
free_timestamp(_ts); // Safe if NULL
return retval;
}
DYNAMIC_API timestamp * new_timestamp(time_t clock)
{
timestamp *ts = calloc(1, sizeof(timestamp));


Loading…
Cancel
Save