(target string)
| 171 | } |
| 172 | |
| 173 | func unmount(target string) error { |
| 174 | for i := 0; i < 50; i++ { |
| 175 | if err := unix.Unmount(target, 0); err != nil { |
| 176 | switch err { |
| 177 | case unix.EBUSY: |
| 178 | time.Sleep(500 * time.Millisecond) |
| 179 | continue |
| 180 | case unix.EINVAL: |
| 181 | default: |
| 182 | return fmt.Errorf("failed to umount %s: %w", target, err) |
| 183 | } |
| 184 | } |
| 185 | return nil |
| 186 | } |
| 187 | return unix.EBUSY |
| 188 | } |
no test coverage detected