diff options
Diffstat (limited to 'internal/app')
| -rw-r--r-- | internal/app/app.go | 2 | ||||
| -rw-r--r-- | internal/app/start.go | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/internal/app/app.go b/internal/app/app.go index 5c5e3452..0055dd76 100644 --- a/internal/app/app.go +++ b/internal/app/app.go @@ -24,6 +24,8 @@ type app struct { id *ID // underlying user switcher process cmd *exec.Cmd + // shim setup abort reason and completion + abort chan error // child process related information seal *appSeal // error returned waiting for process diff --git a/internal/app/start.go b/internal/app/start.go index b6c94041..464d23df 100644 --- a/internal/app/start.go +++ b/internal/app/start.go @@ -63,7 +63,8 @@ func (a *app) Start() error { a.cmd.Stdin, a.cmd.Stdout, a.cmd.Stderr = os.Stdin, os.Stdout, os.Stderr a.cmd.Dir = a.seal.RunDirPath - if err := shim.ServeConfig(confSockPath, a.seal.sys.UID(), &shim.Payload{ + a.abort = make(chan error) + if err := shim.ServeConfig(confSockPath, a.abort, a.seal.sys.UID(), &shim.Payload{ Argv: a.seal.command, Exec: shimExec, Bwrap: a.seal.sys.bwrap, @@ -71,6 +72,8 @@ func (a *app) Start() error { Verbose: fmsg.Verbose(), }, a.seal.wl); err != nil { + a.abort <- err + <-a.abort return fmsg.WrapErrorSuffix(err, "cannot serve shim setup:") } @@ -232,6 +235,8 @@ func (a *app) Wait() (int, error) { } } + a.abort <- errors.New("shim exited") + <-a.abort if err := a.seal.sys.Revert(ec); err != nil { return err.(RevertCompoundError) } |
