mirror of
https://github.com/containers/podman.git
synced 2025-12-04 04:09:40 +08:00
bump buildah to latest
Also includes a small change to make us of https://github.com/containers/buildah/pull/5039 Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
32
vendor/github.com/containers/buildah/copier/hardlink_unix.go
generated
vendored
Normal file
32
vendor/github.com/containers/buildah/copier/hardlink_unix.go
generated
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
//go:build linux || darwin || freebsd
|
||||
// +build linux darwin freebsd
|
||||
|
||||
package copier
|
||||
|
||||
import (
|
||||
"os"
|
||||
"sync"
|
||||
"syscall"
|
||||
)
|
||||
|
||||
type hardlinkDeviceAndInode struct {
|
||||
device, inode uint64
|
||||
}
|
||||
|
||||
type hardlinkChecker struct {
|
||||
hardlinks sync.Map
|
||||
}
|
||||
|
||||
func (h *hardlinkChecker) Check(fi os.FileInfo) string {
|
||||
if st, ok := fi.Sys().(*syscall.Stat_t); ok && fi.Mode().IsRegular() && st.Nlink > 1 {
|
||||
if name, ok := h.hardlinks.Load(makeHardlinkDeviceAndInode(st)); ok && name.(string) != "" {
|
||||
return name.(string)
|
||||
}
|
||||
}
|
||||
return ""
|
||||
}
|
||||
func (h *hardlinkChecker) Add(fi os.FileInfo, name string) {
|
||||
if st, ok := fi.Sys().(*syscall.Stat_t); ok && fi.Mode().IsRegular() && st.Nlink > 1 {
|
||||
h.hardlinks.Store(makeHardlinkDeviceAndInode(st), name)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user