Changeset 5458 for pjproject/trunk/pjlib/src/pj/os_time_common.c
- Timestamp:
- Oct 13, 2016 4:32:29 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjlib/src/pj/os_time_common.c
r4784 r5458 29 29 PJ_DEF(pj_status_t) pj_time_decode(const pj_time_val *tv, pj_parsed_time *pt) 30 30 { 31 struct tm *local_time;31 struct tm local_time; 32 32 33 33 PJ_CHECK_STACK(); 34 34 35 local_time = localtime((time_t*)&tv->sec); 35 #if defined(PJ_HAS_LOCALTIME_R) && PJ_HAS_LOCALTIME_R != 0 36 localtime_r((time_t*)&tv->sec, &local_time); 37 #else 38 /* localtime() is NOT thread-safe. */ 39 local_time = *localtime((time_t*)&tv->sec); 40 #endif 36 41 37 pt->year = local_time ->tm_year+1900;38 pt->mon = local_time ->tm_mon;39 pt->day = local_time ->tm_mday;40 pt->hour = local_time ->tm_hour;41 pt->min = local_time ->tm_min;42 pt->sec = local_time ->tm_sec;43 pt->wday = local_time ->tm_wday;42 pt->year = local_time.tm_year+1900; 43 pt->mon = local_time.tm_mon; 44 pt->day = local_time.tm_mday; 45 pt->hour = local_time.tm_hour; 46 pt->min = local_time.tm_min; 47 pt->sec = local_time.tm_sec; 48 pt->wday = local_time.tm_wday; 44 49 pt->msec = tv->msec; 45 50
Note: See TracChangeset
for help on using the changeset viewer.