summaryrefslogtreecommitdiff
path: root/libgo/misc/cgo/testso
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2020-01-02 15:05:27 -0800
committerIan Lance Taylor <iant@golang.org>2020-01-21 23:53:22 -0800
commit5a8ea165926cb0737ab03bc48c18dc5198ab5305 (patch)
tree962dc3357c57f019f85658f99e2e753e30201c27 /libgo/misc/cgo/testso
parent6ac6529e155c9baa0aaaed7aca06bd38ebda5b43 (diff)
libgo: update to Go1.14beta1
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/214297
Diffstat (limited to 'libgo/misc/cgo/testso')
-rw-r--r--libgo/misc/cgo/testso/overlaydir_test.go11
1 files changed, 4 insertions, 7 deletions
diff --git a/libgo/misc/cgo/testso/overlaydir_test.go b/libgo/misc/cgo/testso/overlaydir_test.go
index 10c874d9258..09a1d512f1e 100644
--- a/libgo/misc/cgo/testso/overlaydir_test.go
+++ b/libgo/misc/cgo/testso/overlaydir_test.go
@@ -21,12 +21,9 @@ func overlayDir(dstRoot, srcRoot string) error {
return err
}
- symBase, err := filepath.Rel(srcRoot, dstRoot)
+ srcRoot, err := filepath.Abs(srcRoot)
if err != nil {
- symBase, err = filepath.Abs(srcRoot)
- if err != nil {
- return err
- }
+ return err
}
return filepath.Walk(srcRoot, func(srcPath string, info os.FileInfo, err error) error {
@@ -52,11 +49,11 @@ func overlayDir(dstRoot, srcRoot string) error {
// Always copy directories (don't symlink them).
// If we add a file in the overlay, we don't want to add it in the original.
if info.IsDir() {
- return os.Mkdir(dstPath, perm)
+ return os.MkdirAll(dstPath, perm|0200)
}
// If the OS supports symlinks, use them instead of copying bytes.
- if err := os.Symlink(filepath.Join(symBase, suffix), dstPath); err == nil {
+ if err := os.Symlink(srcPath, dstPath); err == nil {
return nil
}