mirror of
https://github.com/rclone/rclone.git
synced 2024-11-25 09:41:44 +08:00
atexit: prevent Run from being called on nil signal
This commit is contained in:
parent
d022c81d99
commit
6791cf7d7f
|
@ -29,7 +29,7 @@ func Register(fn func()) {
|
|||
signal.Notify(exitChan, os.Interrupt) // syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT
|
||||
go func() {
|
||||
sig, closed := <-exitChan
|
||||
if closed {
|
||||
if closed || sig == nil {
|
||||
return
|
||||
}
|
||||
fs.Infof(nil, "Signal received: %s", sig)
|
||||
|
|
Loading…
Reference in New Issue
Block a user