github.com/openflowlabs/storage@v1.12.13/drivers/chroot_windows.go (about) 1 package graphdriver 2 3 import ( 4 "fmt" 5 "syscall" 6 ) 7 8 // chrootOrChdir() is either a chdir() to the specified path, or a chroot() to the 9 // specified path followed by chdir() to the new root directory 10 func chrootOrChdir(path string) error { 11 if err := syscall.Chdir(path); err != nil { 12 return fmt.Errorf("error changing to %q: %v", path, err) 13 } 14 return nil 15 }