File tree Expand file tree Collapse file tree 2 files changed +18
-18
lines changed Expand file tree Collapse file tree 2 files changed +18
-18
lines changed Original file line number Diff line number Diff line change @@ -733,24 +733,6 @@ int mingw_chmod(const char *filename, int mode)
733
733
return _wchmod (wfilename , mode );
734
734
}
735
735
736
- /*
737
- * The unit of FILETIME is 100-nanoseconds since January 1, 1601, UTC.
738
- * Returns the 100-nanoseconds ("hekto nanoseconds") since the epoch.
739
- */
740
- static inline long long filetime_to_hnsec (const FILETIME * ft )
741
- {
742
- long long winTime = ((long long )ft -> dwHighDateTime << 32 ) + ft -> dwLowDateTime ;
743
- /* Windows to Unix Epoch conversion */
744
- return winTime - 116444736000000000LL ;
745
- }
746
-
747
- static inline void filetime_to_timespec (const FILETIME * ft , struct timespec * ts )
748
- {
749
- long long hnsec = filetime_to_hnsec (ft );
750
- ts -> tv_sec = (time_t )(hnsec / 10000000 );
751
- ts -> tv_nsec = (hnsec % 10000000 ) * 100 ;
752
- }
753
-
754
736
/**
755
737
* Verifies that safe_create_leading_directories() would succeed.
756
738
*/
Original file line number Diff line number Diff line change @@ -345,6 +345,17 @@ static inline int getrlimit(int resource, struct rlimit *rlp)
345
345
return 0 ;
346
346
}
347
347
348
+ /*
349
+ * The unit of FILETIME is 100-nanoseconds since January 1, 1601, UTC.
350
+ * Returns the 100-nanoseconds ("hekto nanoseconds") since the epoch.
351
+ */
352
+ static inline long long filetime_to_hnsec (const FILETIME * ft )
353
+ {
354
+ long long winTime = ((long long )ft -> dwHighDateTime << 32 ) + ft -> dwLowDateTime ;
355
+ /* Windows to Unix Epoch conversion */
356
+ return winTime - 116444736000000000LL ;
357
+ }
358
+
348
359
/*
349
360
* Use mingw specific stat()/lstat()/fstat() implementations on Windows,
350
361
* including our own struct stat with 64 bit st_size and nanosecond-precision
@@ -361,6 +372,13 @@ struct timespec {
361
372
#endif
362
373
#endif
363
374
375
+ static inline void filetime_to_timespec (const FILETIME * ft , struct timespec * ts )
376
+ {
377
+ long long hnsec = filetime_to_hnsec (ft );
378
+ ts -> tv_sec = (time_t )(hnsec / 10000000 );
379
+ ts -> tv_nsec = (hnsec % 10000000 ) * 100 ;
380
+ }
381
+
364
382
struct mingw_stat {
365
383
_dev_t st_dev ;
366
384
_ino_t st_ino ;
You can’t perform that action at this time.
0 commit comments