fs: preserve nanosecond resolution in uv__fs_to_timespec
Remove microsecond truncation to utilize full nanosecond resolution supported by utimesat().
This commit is contained in:
parent
8fc70344df
commit
8c4198fbb0
@ -224,13 +224,6 @@ static struct timespec uv__fs_to_timespec(double time) {
|
||||
ts.tv_sec = time;
|
||||
ts.tv_nsec = (time - ts.tv_sec) * 1e9;
|
||||
|
||||
/* TODO(bnoordhuis) Remove this. utimesat() has nanosecond resolution but we
|
||||
* stick to microsecond resolution for the sake of consistency with other
|
||||
* platforms. I'm the original author of this compatibility hack but I'm
|
||||
* less convinced it's useful nowadays.
|
||||
*/
|
||||
ts.tv_nsec -= ts.tv_nsec % 1000;
|
||||
|
||||
if (ts.tv_nsec < 0) {
|
||||
ts.tv_nsec += 1e9;
|
||||
ts.tv_sec -= 1;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user