MCPcopy Create free account
hub / github.com/cgsecurity/testdisk / set_secwest

Function set_secwest

src/common.c:396–429  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

394}
395
396void set_secwest(void)
397{
398 const time_t t = time(NULL);
399#if defined(__MINGW32__) || defined(DISABLED_FOR_FRAMAC)
400 const struct tm *tmptr = localtime(&t);
401#else
402 struct tm tmp;
403 const struct tm *tmptr = localtime_r(&t,&tmp);
404#endif
405#ifdef HAVE_STRUCT_TM_TM_GMTOFF
406 if(tmptr)
407 secwest = -1 * tmptr->tm_gmtoff;
408 else
409 secwest = 0;
410#elif defined (DJGPP) || defined(__ANDROID__)
411 secwest = 0;
412#else
413#if defined (__CYGWIN__)
414 secwest = _timezone;
415#else
416 secwest = timezone;
417#endif
418#ifdef __FRAMAC__
419 if(secwest < -48*3600)
420 {
421 secwest=0;
422 return;
423 }
424#endif
425 /* account for daylight savings */
426 if (tmptr && tmptr->tm_isdst)
427 secwest -= 3600;
428#endif
429}
430
431/**
432 * td_ntfs2utc - Convert an NTFS time to Unix time

Callers 2

dir_partition_exfat_initFunction · 0.85
dir_partition_fat_initFunction · 0.85

Calls 1

localtime_rFunction · 0.85

Tested by

no test coverage detected