dbus: filter exit errors caused by signal
All checks were successful
Test / Create distribution (push) Successful in 26s
Test / Fortify (push) Successful in 2m14s
Test / Data race detector (push) Successful in 2m58s
Test / Flake checks (push) Successful in 44s

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
Ophestra 2025-02-23 23:54:36 +09:00
parent 3f869f0bf2
commit 6cf6924fe5
Signed by: cat
SSH Key Fingerprint: SHA256:gQ67O0enBZ7UdZypgtspB2FDM1g3GVw8nX0XSdcFw8Q
2 changed files with 10 additions and 0 deletions

View File

@ -149,6 +149,15 @@ func (p *Proxy) Wait() error {
errs[0] = nil
}
var exitError *exec.ExitError
if errors.As(errs[0], &exitError) &&
exitError != nil &&
exitError.Exited() &&
exitError.ExitCode() == -1 {
// exit due to signal
errs[0] = nil
}
// ensure socket removal so ephemeral directory is empty at revert
if err := os.Remove(p.session[1]); err != nil && !errors.Is(err, os.ErrNotExist) {
errs[1] = err

View File

@ -84,6 +84,7 @@ func (seal *outcome) Run(ctx context.Context, rs *fst.RunState) error {
ec.Set(system.Process)
if states, err := c.Load(); err != nil {
// revert per-process state here to limit damage
fmsg.Verbosef("cannot load state entries: %v", err)
return errors.Join(err, seal.sys.Revert(ec))
} else {
if l := len(states); l == 0 {