| 131 | } |
| 132 | |
| 133 | func mountPoints(deviceNames []string) ([]string, error) { |
| 134 | conn, err := dbus.ConnectSystemBus() |
| 135 | if err != nil { |
| 136 | return nil, fmt.Errorf("failed to connect to system bus: %v", err) |
| 137 | } |
| 138 | defer conn.Close() |
| 139 | |
| 140 | var mps []string |
| 141 | for _, deviceName := range deviceNames { |
| 142 | mps1, err := retry(5, 200*time.Millisecond, deviceName, conn, fetchMountPoints) |
| 143 | if err != nil { |
| 144 | return nil, err |
| 145 | } |
| 146 | mps = append(mps1, mps...) |
| 147 | } |
| 148 | |
| 149 | return mps, nil |
| 150 | } |
| 151 | |
| 152 | func fetchMountPoints(deviceName string, conn *dbus.Conn) ([]string, error) { |
| 153 | var mountPoints []string |