lib/atexit: unregister interrupt handler once it has fired so users can interrupt again

This commit is contained in:
Nick Craig-Wood 2021-03-22 20:45:07 +00:00
parent a2cd5d8fa3
commit cb46092883

View file

@ -46,6 +46,7 @@ func Register(fn func()) FnHandle {
if sig == nil {
return
}
signal.Stop(exitChan)
atomic.StoreInt32(&signalled, 1)
fs.Infof(nil, "Signal received: %s", sig)
Run()