mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
d8e1746466
full diff: d72af97c0e...b19f7f9cb2
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
20 lines
351 B
Go
20 lines
351 B
Go
//go:build freebsd || solaris
|
|
// +build freebsd solaris
|
|
|
|
package fs
|
|
|
|
import (
|
|
"os"
|
|
"syscall"
|
|
|
|
"github.com/pkg/errors"
|
|
"golang.org/x/sys/unix"
|
|
)
|
|
|
|
func copyDevice(dst string, fi os.FileInfo) error {
|
|
st, ok := fi.Sys().(*syscall.Stat_t)
|
|
if !ok {
|
|
return errors.New("unsupported stat type")
|
|
}
|
|
return unix.Mknod(dst, uint32(fi.Mode()), st.Rdev)
|
|
}
|