mirror of
https://github.com/rclone/rclone.git
synced 2024-11-22 20:59:10 +08:00
mount: fix macOS not noticing errors with --daemon
See: https://forum.rclone.org/t/rclone-mount-daemon-exits-successfully-even-when-mount-fails/43146
This commit is contained in:
parent
96f8b7c827
commit
9bfbf2a4ae
|
@ -10,6 +10,7 @@ import (
|
|||
"runtime"
|
||||
"strings"
|
||||
"sync"
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
"github.com/rclone/rclone/cmd"
|
||||
|
@ -222,6 +223,13 @@ func NewMountCommand(commandName string, hidden bool, mount MountFn) *cobra.Comm
|
|||
err = WaitMountReady(mnt.MountPoint, Opt.DaemonWait)
|
||||
if err != nil {
|
||||
killDaemon("Daemon timed out")
|
||||
} else {
|
||||
// Double check daemon is still alive
|
||||
// on non Linux OSes WaitMountReady is just a no-op
|
||||
err = daemon.Signal(syscall.Signal(0))
|
||||
if err != nil {
|
||||
err = fmt.Errorf("daemon has died: %w", err)
|
||||
}
|
||||
}
|
||||
atexit.Unregister(handle)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user