summaryrefslogtreecommitdiffstats
path: root/dockerclient/conformance_unix_test.go
blob: 8bc1d824acf343edff29ecfb75e5976ad170349c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
//go:build conformance && !windows
// +build conformance,!windows

package dockerclient

import (
	"os"
	"syscall"
)

type hardlinkCheckerKey struct {
	device, inode uint64
}

func (h *hardlinkChecker) makeHardlinkCheckerKey(info os.FileInfo) *hardlinkCheckerKey {
	sys := info.Sys()
	if stat, ok := sys.(*syscall.Stat_t); ok && (stat.Nlink > 1) {
		return &hardlinkCheckerKey{device: uint64(stat.Dev), inode: uint64(stat.Ino)}
	}
	return nil
}