Files
moby/pkg/system
Sebastiaan van Stijn 7bd051eeec pkg/system: windows: setCTime(): remove redundant conversion
It looks like this function was converting the time (`windows.NsecToTimespec()`),
only to convert it back (`windows.TimespecToNsec()`). This became clear when
moving the lines together:

```go
ctimespec := windows.NsecToTimespec(ctime.UnixNano())
c := windows.NsecToFiletime(windows.TimespecToNsec(ctimespec))
```

And looking at the Golang code, it looks like they're indeed the exact reverse:

```go
func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }

func NsecToTimespec(nsec int64) (ts Timespec) {
    ts.Sec = nsec / 1e9
    ts.Nsec = nsec % 1e9
    return
}
```

While modifying this code, also renaming the `e` variable to a more common `err`.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-10-07 18:34:44 +02:00
..
2018-02-05 16:51:57 -05:00
2018-02-05 16:51:57 -05:00
2018-02-05 16:51:57 -05:00
2021-12-15 22:15:07 -08:00
2018-02-05 16:51:57 -05:00
2021-09-22 09:47:35 +03:00
2022-09-28 01:58:49 +02:00
2018-02-05 16:51:57 -05:00
2021-06-10 13:03:42 +02:00
2018-02-05 16:51:57 -05:00
2020-08-12 11:40:58 +02:00
2022-10-05 16:21:04 +02:00