@@ -58,7 +58,9 @@ func removeAll(path string) error {
58
58
func removeAllFrom (parent * File , base string ) error {
59
59
parentFd := int (parent .Fd ())
60
60
// Simple case: if Unlink (aka remove) works, we're done.
61
- err := unix .Unlinkat (parentFd , base , 0 )
61
+ err := ignoringEINTR (func () error {
62
+ return unix .Unlinkat (parentFd , base , 0 )
63
+ })
62
64
if err == nil || IsNotExist (err ) {
63
65
return nil
64
66
}
@@ -75,7 +77,9 @@ func removeAllFrom(parent *File, base string) error {
75
77
76
78
// Is this a directory we need to recurse into?
77
79
var statInfo syscall.Stat_t
78
- statErr := unix .Fstatat (parentFd , base , & statInfo , unix .AT_SYMLINK_NOFOLLOW )
80
+ statErr := ignoringEINTR (func () error {
81
+ return unix .Fstatat (parentFd , base , & statInfo , unix .AT_SYMLINK_NOFOLLOW )
82
+ })
79
83
if statErr != nil {
80
84
if IsNotExist (statErr ) {
81
85
return nil
@@ -151,7 +155,9 @@ func removeAllFrom(parent *File, base string) error {
151
155
}
152
156
153
157
// Remove the directory itself.
154
- unlinkError := unix .Unlinkat (parentFd , base , unix .AT_REMOVEDIR )
158
+ unlinkError := ignoringEINTR (func () error {
159
+ return unix .Unlinkat (parentFd , base , unix .AT_REMOVEDIR )
160
+ })
155
161
if unlinkError == nil || IsNotExist (unlinkError ) {
156
162
return nil
157
163
}
0 commit comments