|
| 1 | +diff --git a/src/os/removeall_at.go b/src/os/removeall_at.go |
| 2 | +index 5ddc1ade6134e5..61298a46bc70df 100644 |
| 3 | +--- a/src/os/removeall_at.go |
| 4 | ++++ b/src/os/removeall_at.go |
| 5 | +@@ -2,7 +2,7 @@ |
| 6 | + // Use of this source code is governed by a BSD-style |
| 7 | + // license that can be found in the LICENSE file. |
| 8 | + |
| 9 | +-//go:build unix || wasip1 || windows |
| 10 | ++//go:build unix || wasip1 |
| 11 | + |
| 12 | + package os |
| 13 | + |
| 14 | +diff --git a/src/os/removeall_noat.go b/src/os/removeall_noat.go |
| 15 | +index 395a1503d49442..02f6fca70283f7 100644 |
| 16 | +--- a/src/os/removeall_noat.go |
| 17 | ++++ b/src/os/removeall_noat.go |
| 18 | +@@ -2,7 +2,7 @@ |
| 19 | + // Use of this source code is governed by a BSD-style |
| 20 | + // license that can be found in the LICENSE file. |
| 21 | + |
| 22 | +-//go:build (js && wasm) || plan9 |
| 23 | ++//go:build (js && wasm) || plan9 || windows |
| 24 | + |
| 25 | + package os |
| 26 | + |
| 27 | +diff --git a/src/os/root.go b/src/os/root.go |
| 28 | +index d759727ce7a89b..1ecbcc094f15b0 100644 |
| 29 | +--- a/src/os/root.go |
| 30 | ++++ b/src/os/root.go |
| 31 | +@@ -189,12 +189,6 @@ func (r *Root) Remove(name string) error { |
| 32 | + return rootRemove(r, name) |
| 33 | + } |
| 34 | + |
| 35 | +-// RemoveAll removes the named file or directory and any children that it contains. |
| 36 | +-// See [RemoveAll] for more details. |
| 37 | +-func (r *Root) RemoveAll(name string) error { |
| 38 | +- return rootRemoveAll(r, name) |
| 39 | +-} |
| 40 | +- |
| 41 | + // Stat returns a [FileInfo] describing the named file in the root. |
| 42 | + // See [Stat] for more details. |
| 43 | + func (r *Root) Stat(name string) (FileInfo, error) { |
| 44 | +diff --git a/src/os/root_noopenat.go b/src/os/root_noopenat.go |
| 45 | +index 59f1abe91b0b2e..ecdf264f28d7d6 100644 |
| 46 | +--- a/src/os/root_noopenat.go |
| 47 | ++++ b/src/os/root_noopenat.go |
| 48 | +@@ -11,7 +11,6 @@ import ( |
| 49 | + "internal/filepathlite" |
| 50 | + "internal/stringslite" |
| 51 | + "sync/atomic" |
| 52 | +- "syscall" |
| 53 | + "time" |
| 54 | + ) |
| 55 | + |
| 56 | +@@ -186,25 +185,6 @@ func rootRemove(r *Root, name string) error { |
| 57 | + return nil |
| 58 | + } |
| 59 | + |
| 60 | +-func rootRemoveAll(r *Root, name string) error { |
| 61 | +- if endsWithDot(name) { |
| 62 | +- // Consistency with os.RemoveAll: Return EINVAL when trying to remove . |
| 63 | +- return &PathError{Op: "RemoveAll", Path: name, Err: syscall.EINVAL} |
| 64 | +- } |
| 65 | +- if err := checkPathEscapesLstat(r, name); err != nil { |
| 66 | +- if err == syscall.ENOTDIR { |
| 67 | +- // Some intermediate path component is not a directory. |
| 68 | +- // RemoveAll treats this as success (since the target doesn't exist). |
| 69 | +- return nil |
| 70 | +- } |
| 71 | +- return &PathError{Op: "RemoveAll", Path: name, Err: err} |
| 72 | +- } |
| 73 | +- if err := RemoveAll(joinPath(r.root.name, name)); err != nil { |
| 74 | +- return &PathError{Op: "RemoveAll", Path: name, Err: underlyingError(err)} |
| 75 | +- } |
| 76 | +- return nil |
| 77 | +-} |
| 78 | +- |
| 79 | + func rootReadlink(r *Root, name string) (string, error) { |
| 80 | + if err := checkPathEscapesLstat(r, name); err != nil { |
| 81 | + return "", &PathError{Op: "readlinkat", Path: name, Err: err} |
| 82 | +diff --git a/src/os/root_openat.go b/src/os/root_openat.go |
| 83 | +index 192c29e319d394..f5473e75bd6adf 100644 |
| 84 | +--- a/src/os/root_openat.go |
| 85 | ++++ b/src/os/root_openat.go |
| 86 | +@@ -197,28 +197,6 @@ func rootRemove(r *Root, name string) error { |
| 87 | + return nil |
| 88 | + } |
| 89 | + |
| 90 | +-func rootRemoveAll(r *Root, name string) error { |
| 91 | +- // Consistency with os.RemoveAll: Strip trailing /s from the name, |
| 92 | +- // so RemoveAll("not_a_directory/") succeeds. |
| 93 | +- for len(name) > 0 && IsPathSeparator(name[len(name)-1]) { |
| 94 | +- name = name[:len(name)-1] |
| 95 | +- } |
| 96 | +- if endsWithDot(name) { |
| 97 | +- // Consistency with os.RemoveAll: Return EINVAL when trying to remove . |
| 98 | +- return &PathError{Op: "RemoveAll", Path: name, Err: syscall.EINVAL} |
| 99 | +- } |
| 100 | +- _, err := doInRoot(r, name, nil, func(parent sysfdType, name string) (struct{}, error) { |
| 101 | +- return struct{}{}, removeAllFrom(parent, name) |
| 102 | +- }) |
| 103 | +- if IsNotExist(err) { |
| 104 | +- return nil |
| 105 | +- } |
| 106 | +- if err != nil { |
| 107 | +- return &PathError{Op: "RemoveAll", Path: name, Err: underlyingError(err)} |
| 108 | +- } |
| 109 | +- return err |
| 110 | +-} |
| 111 | +- |
| 112 | + func rootRename(r *Root, oldname, newname string) error { |
| 113 | + _, err := doInRoot(r, oldname, nil, func(oldparent sysfdType, oldname string) (struct{}, error) { |
| 114 | + _, err := doInRoot(r, newname, nil, func(newparent sysfdType, newname string) (struct{}, error) { |
1 | 115 | diff --git a/src/crypto/internal/sysrand/rand_windows.go b/src/crypto/internal/sysrand/rand_windows.go |
2 | 116 | index 91f1490c15cda3..0c9f06787d0fb3 100644 |
3 | 117 | --- a/src/crypto/internal/sysrand/rand_windows.go |
|
0 commit comments