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 @@ -651,24 +651,6 @@ int mingw_chmod(const char *filename, int mode)
651
651
return _wchmod (wfilename , mode );
652
652
}
653
653
654
- /*
655
- * The unit of FILETIME is 100-nanoseconds since January 1, 1601, UTC.
656
- * Returns the 100-nanoseconds ("hekto nanoseconds") since the epoch.
657
- */
658
- static inline long long filetime_to_hnsec (const FILETIME * ft )
659
- {
660
- long long winTime = ((long long )ft -> dwHighDateTime << 32 ) + ft -> dwLowDateTime ;
661
- /* Windows to Unix Epoch conversion */
662
- return winTime - 116444736000000000LL ;
663
- }
664
-
665
- static inline void filetime_to_timespec (const FILETIME * ft , struct timespec * ts )
666
- {
667
- long long hnsec = filetime_to_hnsec (ft );
668
- ts -> tv_sec = (time_t )(hnsec / 10000000 );
669
- ts -> tv_nsec = (hnsec % 10000000 ) * 100 ;
670
- }
671
-
672
654
/**
673
655
* Verifies that safe_create_leading_directories() would succeed.
674
656
*/
Original file line number Diff line number Diff line change @@ -344,6 +344,17 @@ static inline int getrlimit(int resource, struct rlimit *rlp)
344
344
return 0 ;
345
345
}
346
346
347
+ /*
348
+ * The unit of FILETIME is 100-nanoseconds since January 1, 1601, UTC.
349
+ * Returns the 100-nanoseconds ("hekto nanoseconds") since the epoch.
350
+ */
351
+ static inline long long filetime_to_hnsec (const FILETIME * ft )
352
+ {
353
+ long long winTime = ((long long )ft -> dwHighDateTime << 32 ) + ft -> dwLowDateTime ;
354
+ /* Windows to Unix Epoch conversion */
355
+ return winTime - 116444736000000000LL ;
356
+ }
357
+
347
358
/*
348
359
* Use mingw specific stat()/lstat()/fstat() implementations on Windows,
349
360
* including our own struct stat with 64 bit st_size and nanosecond-precision
@@ -360,6 +371,13 @@ struct timespec {
360
371
#endif
361
372
#endif
362
373
374
+ static inline void filetime_to_timespec (const FILETIME * ft , struct timespec * ts )
375
+ {
376
+ long long hnsec = filetime_to_hnsec (ft );
377
+ ts -> tv_sec = (time_t )(hnsec / 10000000 );
378
+ ts -> tv_nsec = (hnsec % 10000000 ) * 100 ;
379
+ }
380
+
363
381
struct mingw_stat {
364
382
_dev_t st_dev ;
365
383
_ino_t st_ino ;
You can’t perform that action at this time.
0 commit comments