"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "vendor/archive/tar/stat_unix.go" between
moby-20.10.7.tar.gz and moby-20.10.8.tar.gz

About: Moby is a framework to assemble specialized container systems (formerly project name Docker; see here to clarify the relationship between the projects).

stat_unix.go  (moby-20.10.7):stat_unix.go  (moby-20.10.8)
// Copyright 2012 The Go Authors. All rights reserved. // Copyright 2012 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
// +build aix linux darwin dragonfly freebsd openbsd netbsd solaris // +build aix linux darwin dragonfly freebsd openbsd netbsd solaris
package tar package tar
import ( import (
"os" "io/fs"
"runtime" "runtime"
"syscall" "syscall"
) )
func init() { func init() {
sysStat = statUnix sysStat = statUnix
} }
func statUnix(fi os.FileInfo, h *Header) error { func statUnix(fi fs.FileInfo, h *Header) error {
sys, ok := fi.Sys().(*syscall.Stat_t) sys, ok := fi.Sys().(*syscall.Stat_t)
if !ok { if !ok {
return nil return nil
} }
h.Uid = int(sys.Uid) h.Uid = int(sys.Uid)
h.Gid = int(sys.Gid) h.Gid = int(sys.Gid)
// TODO(bradfitz): populate username & group. os/user // TODO(bradfitz): populate username & group. os/user
// doesn't cache LookupId lookups, and lacks group // doesn't cache LookupId lookups, and lacks group
// lookup functions. // lookup functions.
skipping to change at line 49 skipping to change at line 49
major = uint32((dev & 0x3fffffff00000000) >> 32) major = uint32((dev & 0x3fffffff00000000) >> 32)
minor = uint32((dev & 0x00000000ffffffff) >> 0) minor = uint32((dev & 0x00000000ffffffff) >> 0)
h.Devmajor, h.Devminor = int64(major), int64(minor) h.Devmajor, h.Devminor = int64(major), int64(minor)
case "linux": case "linux":
// Copied from golang.org/x/sys/unix/dev_linux.go. // Copied from golang.org/x/sys/unix/dev_linux.go.
major := uint32((dev & 0x00000000000fff00) >> 8) major := uint32((dev & 0x00000000000fff00) >> 8)
major |= uint32((dev & 0xfffff00000000000) >> 32) major |= uint32((dev & 0xfffff00000000000) >> 32)
minor := uint32((dev & 0x00000000000000ff) >> 0) minor := uint32((dev & 0x00000000000000ff) >> 0)
minor |= uint32((dev & 0x00000ffffff00000) >> 12) minor |= uint32((dev & 0x00000ffffff00000) >> 12)
h.Devmajor, h.Devminor = int64(major), int64(minor) h.Devmajor, h.Devminor = int64(major), int64(minor)
case "darwin": case "darwin", "ios":
// Copied from golang.org/x/sys/unix/dev_darwin.go. // Copied from golang.org/x/sys/unix/dev_darwin.go.
major := uint32((dev >> 24) & 0xff) major := uint32((dev >> 24) & 0xff)
minor := uint32(dev & 0xffffff) minor := uint32(dev & 0xffffff)
h.Devmajor, h.Devminor = int64(major), int64(minor) h.Devmajor, h.Devminor = int64(major), int64(minor)
case "dragonfly": case "dragonfly":
// Copied from golang.org/x/sys/unix/dev_dragonfly.go. // Copied from golang.org/x/sys/unix/dev_dragonfly.go.
major := uint32((dev >> 8) & 0xff) major := uint32((dev >> 8) & 0xff)
minor := uint32(dev & 0xffff00ff) minor := uint32(dev & 0xffff00ff)
h.Devmajor, h.Devminor = int64(major), int64(minor) h.Devmajor, h.Devminor = int64(major), int64(minor)
case "freebsd": case "freebsd":
 End of changes. 3 change blocks. 
3 lines changed or deleted 3 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)