(target string, flags int)
| 74 | } |
| 75 | |
| 76 | func unmount(target string, flags int) error { |
| 77 | if isFUSE(target) { |
| 78 | // TODO: Why error is ignored? |
| 79 | // Shouldn't this just be unconditional "return unmountFUSE(target)"? |
| 80 | if err := unmountFUSE(target); err == nil { |
| 81 | return nil |
| 82 | } |
| 83 | } |
| 84 | for range 50 { |
| 85 | if err := unix.Unmount(target, flags); err != nil { |
| 86 | switch err { |
| 87 | case unix.EBUSY: |
| 88 | time.Sleep(50 * time.Millisecond) |
| 89 | continue |
| 90 | default: |
| 91 | return err |
| 92 | } |
| 93 | } |
| 94 | return nil |
| 95 | } |
| 96 | return fmt.Errorf("failed to unmount target %s: %w", target, unix.EBUSY) |
| 97 | } |
| 98 | |
| 99 | // Unmount the provided mount path with the flags |
| 100 | func Unmount(target string, flags int) error { |
no test coverage detected
searching dependent graphs…