Add support for devices
Address code comments from previous commit Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
This commit is contained in:
parent
200cd6e877
commit
f78105d832
5 changed files with 28 additions and 9 deletions
|
@ -108,3 +108,11 @@ func copyXAttrs(dst, src string) error {
|
|||
|
||||
return nil
|
||||
}
|
||||
|
||||
func copyDevice(dst string, fi os.FileInfo) error {
|
||||
st, ok := fi.Sys().(*syscall.Stat_t)
|
||||
if !ok {
|
||||
return errors.New("unsupported stat type")
|
||||
}
|
||||
return syscall.Mknod(dst, uint32(fi.Mode().Perm()), int(st.Rdev))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue