containerd/archive
Sebastiaan van Stijn 0aefb52807
archive: windows: chtimes(): 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 19:38:56 +02:00
..
compression Drop deprecated ioutil 2022-07-23 08:36:20 -07:00
tartest Fix annotation typo error 2018-12-14 23:18:42 +08:00
issues_test.go Add NoSameOwner option when unpacking tars 2022-09-09 17:07:26 -07:00
link_default.go archive: use Linkat on FreeBSD for hardlinks 2022-06-09 18:54:09 -07:00
link_freebsd.go archive: use Linkat on FreeBSD for hardlinks 2022-06-09 18:54:09 -07:00
tar_freebsd.go Remove redundant build tags 2021-08-05 22:27:46 -07:00
tar_linux_test.go test: use T.TempDir to create temporary test directory 2022-03-15 14:03:50 +08:00
tar_mostunix.go Run go fmt with Go 1.17 2021-08-22 09:31:50 +09:00
tar_opts_linux.go Remove redundant build tags 2021-08-05 22:27:46 -07:00
tar_opts_windows.go docs: rename main to master 2021-08-10 09:42:16 -07:00
tar_opts.go Add NoSameOwner option when unpacking tars 2022-09-09 17:07:26 -07:00
tar_test.go archive: Explicitly specify stdio for tar(1) 2022-06-09 18:54:10 -07:00
tar_unix.go archive: replace tarName() with filepath.ToSlash() 2022-08-30 15:19:58 +02:00
tar_windows.go Merge pull request #7344 from thaJeztah/archive_cleanup 2022-08-30 09:18:18 -07:00
tar.go Merge pull request #7386 from mxpv/no-same-owner 2022-09-09 21:52:41 -07:00
time_unix.go feat: replace github.com/pkg/errors to errors 2022-01-07 10:27:03 +08:00
time_windows.go archive: windows: chtimes(): remove redundant conversion 2022-10-07 19:38:56 +02:00
time.go Licence header added 2018-02-19 10:32:26 +09:00