loopd: close error channel on shutdown

To avoid listeners of the error channel to block after the daemon
has already shut down, we close the channel once we're finished.
pull/214/head
Oliver Gugger 4 years ago
parent 4871abfc80
commit e2ce84305f
No known key found for this signature in database
GPG Key ID: 8E4256593F177720

@ -374,6 +374,9 @@ func (d *Daemon) initialize() error {
// The caller expects exactly one message. So we send the error
// even if it's nil because we cleanly shut down.
d.ErrChan <- runtimeErr
// Make sure all further reads on the channel return instantly.
close(d.ErrChan)
}()
return nil

Loading…
Cancel
Save