mirror of
https://github.com/rclone/rclone.git
synced 2024-11-07 17:14:44 +01:00
rc: handle external unmount when mounting
Before this change, if the a mount was created via the rc but unmounted externally with `fusermount -u` say, rclone would still believe the mount was active when it wasn't.
This commit is contained in:
parent
a3c06b9bbe
commit
c5109408c0
@ -122,7 +122,15 @@ func mountRc(ctx context.Context, in rc.Params) (out rc.Params, err error) {
|
||||
log.Printf("mount FAILED: %v", err)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
go func() {
|
||||
if err = mnt.Wait(); err != nil {
|
||||
log.Printf("unmount FAILED: %v", err)
|
||||
return
|
||||
}
|
||||
mountMu.Lock()
|
||||
defer mountMu.Unlock()
|
||||
delete(liveMounts, mountPoint)
|
||||
}()
|
||||
// Add mount to list if mount point was successfully created
|
||||
liveMounts[mountPoint] = mnt
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user