prevent remount during exit to avoid killing 9pfuse
This commit is contained in:
parent
aecd2b658d
commit
2da9867f99
6
main.go
6
main.go
|
|
@ -9,12 +9,14 @@ import (
|
||||||
"sort"
|
"sort"
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
|
"sync/atomic"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"9fans.net/go/acme"
|
"9fans.net/go/acme"
|
||||||
)
|
)
|
||||||
|
|
||||||
var ollie string
|
var ollie string
|
||||||
|
var exiting atomic.Bool
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
ollie = os.Getenv("OLLIE")
|
ollie = os.Getenv("OLLIE")
|
||||||
|
|
@ -24,6 +26,9 @@ func init() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func remount() {
|
func remount() {
|
||||||
|
if exiting.Load() {
|
||||||
|
return
|
||||||
|
}
|
||||||
exec.Command("ollie-remount").Run() //nolint:errcheck
|
exec.Command("ollie-remount").Run() //nolint:errcheck
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -164,6 +169,7 @@ func (sl *sessionList) eventLoop() {
|
||||||
sl.win.WriteEvent(e)
|
sl.win.WriteEvent(e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
exiting.Store(true)
|
||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Reference in New Issue