File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,10 +13,11 @@ import (
1313
1414// RPCPlugin manages the lifecycle of an external process plugin.
1515type RPCPlugin struct {
16- path string
17- cmd * exec.Cmd
18- sess * f4rpc.Session
19- api vfs.HostAPI
16+ path string
17+ cmd * exec.Cmd
18+ sess * f4rpc.Session
19+ api vfs.HostAPI
20+ closing bool
2021}
2122
2223func NewRPCPlugin (path string ) * RPCPlugin {
@@ -77,7 +78,9 @@ func (p *RPCPlugin) Init(api vfs.HostAPI) error {
7778
7879 go func () {
7980 err := p .sess .Serve ()
80- vtui .DebugLog ("RPC Plugin %q exited: %v" , p .path , err )
81+ if ! p .closing {
82+ vtui .DebugLog ("RPC Plugin %q terminated unexpectedly: %v" , p .path , err )
83+ }
8184 }()
8285
8386 // Query plugin for its capabilities (drives)
@@ -100,6 +103,7 @@ func (p *RPCPlugin) Init(api vfs.HostAPI) error {
100103}
101104
102105func (p * RPCPlugin ) Close () error {
106+ p .closing = true
103107 if p .cmd != nil && p .cmd .Process != nil {
104108 p .cmd .Process .Kill ()
105109 p .cmd .Wait ()
You can’t perform that action at this time.
0 commit comments