File: conformance_unix_test.go

package info (click to toggle)
golang-github-openshift-imagebuilder 1.2.15%2Bds1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,776 kB
  • sloc: makefile: 18; sh: 3; ansic: 1
file content (21 lines) | stat: -rw-r--r-- 445 bytes parent folder | download
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
}