- Timestamp:
- 08/03/05 22:41:25 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/smb_deps.c
r31 r42 80 80 } 81 81 82 83 /**************************************************************************** 84 Interpret an 8 byte "filetime" structure to a time_t 85 It's originally in "100ns units since jan 1st 1601" 86 87 An 8 byte value of 0xffffffffffffffff will be returned as (time_t)0. 88 89 It appears to be kludge-GMT (at least for file listings). This means 90 its the GMT you get by taking a localtime and adding the 91 serverzone. This is NOT the same as GMT in some cases. This routine 92 converts this to real GMT. 93 ****************************************************************************/ 94 time_t nt_time_to_unix(NTTIME *nt) 95 { 96 double d; 97 time_t ret; 98 /* The next two lines are a fix needed for the 99 broken SCO compiler. JRA. */ 100 time_t l_time_min = TIME_T_MIN; 101 time_t l_time_max = TIME_T_MAX; 102 103 if (nt->high == 0 || (nt->high == 0xffffffff && nt->low == 0xffffffff)) 104 return(0); 105 106 d = ((double)nt->high)*4.0*(double)(1<<30); 107 d += (nt->low&0xFFF00000); 108 d *= 1.0e-7; 109 110 /* now adjust by 369 years to make the secs since 1970 */ 111 d -= TIME_FIXUP_CONSTANT; 112 113 if (d <= l_time_min) 114 return (l_time_min); 115 116 if (d >= l_time_max) 117 return (l_time_max); 118 119 ret = (time_t)(d+0.5); 120 121 /* this takes us from kludge-GMT to real GMT */ 122 /*XXX 123 ret -= get_serverzone(); 124 ret += LocTimeDiff(ret); 125 */ 126 return(ret); 127 } 128 129 82 130 /* End of stuff from lib/time.c */ 83 131
Note: See TracChangeset
for help on using the changeset viewer.