mirror of
https://github.com/rclone/rclone.git
synced 2025-08-16 16:41:34 +02:00
mount: ensure atexit gets run on interrupt
When running `rclone mount`, there were 2 signal handlers for `os.Interrupt`. Those handlers would run concurrently and in some cases cause either unmount or `atexit.Run()` being skipped. In addition `atexit.Run()` will get called in `resolveExitCode` to ensure cleanup on errors.
This commit is contained in:
committed by
Nick Craig-Wood
parent
cdde8fa75a
commit
d022c81d99
@ -471,6 +471,7 @@ func initConfig() {
|
||||
}
|
||||
|
||||
func resolveExitCode(err error) {
|
||||
atexit.Run()
|
||||
if err == nil {
|
||||
os.Exit(exitCodeSuccess)
|
||||
}
|
||||
|
Reference in New Issue
Block a user