func createDeviceNode(rootfs string, node *configs.Device, bind bool) error {
	dest := filepath.Join(rootfs, node.Path)
	if err := os.MkdirAll(filepath.Dir(dest), 0755); err != nil {
		return err
	}

	if bind {
		f, err := os.Create(dest)
		if err != nil && !os.IsExist(err) {
			return err
		}
		if f != nil {
			f.Close()
		}
		return syscall.Mount(node.Path, dest, "bind", syscall.MS_BIND, "")
	}
	if err := mknodDevice(dest, node); err != nil {
		if os.IsExist(err) {
			return nil
		}
		return err
	}
	return nil
}
func createDeviceNode(rootfs string, node *configs.Device, bind bool) error {
	dest := filepath.Join(rootfs, node.Path)
	if err := os.MkdirAll(filepath.Dir(dest), 0755); err != nil {
		return err
	}

	if bind {
		f, err := os.Create(dest)
		if err != nil && !os.IsExist(err) {
			return err
		}
		if f != nil {
			f.Close()
		}
		return syscall.Mount(node.Path, dest, "bind", syscall.MS_BIND, "")
	}
	if err := mknodDevice(dest, node); err != nil {
		if os.IsExist(err) {
			return nil
		}
		return err
	}
	return nil
}
func createDeviceNode ( rootfs string , node * configs . Device , bind bool ) error { dest := filepath . Join ( rootfs , node . Path ) if err := os . MkdirAll ( filepath . Dir ( dest ) , 0755 ) ; err != nil { return err } if bind { f , err := os . Create ( dest ) if err != nil && ! os . IsExist ( err ) { return err } if f != nil { f . Close ( ) } return syscall . Mount ( node . Path , dest , " " , syscall . MS_BIND , " " ) } if err := mknodDevice ( dest , node ) ; err != nil { if os . IsExist ( err ) { return nil } return err } return nil }
// Creates the device node in the rootfs of the container.
Creates the device node in the rootfs of the container .