mirror of
https://github.com/rclone/rclone.git
synced 2025-02-04 04:29:18 +01:00
cmount: check for filesystem blowing up before Init is called
This commit is contained in:
parent
0384364c3e
commit
e6ffe3464c
@ -269,8 +269,15 @@ func mount(f fs.Fs, mountpoint string) (*mountlib.FS, <-chan error, func() error
|
|||||||
return errors.New("host unmount failed")
|
return errors.New("host unmount failed")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Wait for the filesystem to become ready
|
// Wait for the filesystem to become ready, checking the file
|
||||||
<-fsys.ready
|
// system didn't blow up before starting
|
||||||
|
select {
|
||||||
|
case err := <-errChan:
|
||||||
|
err = errors.Wrap(err, "mount stopped before calling Init")
|
||||||
|
return nil, nil, nil, err
|
||||||
|
case <-fsys.ready:
|
||||||
|
}
|
||||||
|
|
||||||
return fsys.FS, errChan, unmount, nil
|
return fsys.FS, errChan, unmount, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user