aboutsummaryrefslogtreecommitdiffhomepage
path: root/dbus/run.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-03-14 18:30:22 +0900
committerOphestra <cat@gensokyo.uk>2025-03-14 18:30:22 +0900
commit7c60a4d8e8baa77b42789c041838fa82dd7d36f9 (patch)
treeb859b33bd4d522229e2b497992ef42243f1b22d7 /dbus/run.go
parent4bb5d9780f3c46e942dc778d93c28391caee33c7 (diff)
helper: embed context on creation
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'dbus/run.go')
-rw-r--r--dbus/run.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/dbus/run.go b/dbus/run.go
index 074fb92d..fc3943a5 100644
--- a/dbus/run.go
+++ b/dbus/run.go
@@ -37,8 +37,9 @@ func (p *Proxy) Start(ctx context.Context, output io.Writer, sandbox bool) error
}
)
+ c, cancel := context.WithCancelCause(ctx)
if !sandbox {
- h = helper.New(p.seal, p.name, argF)
+ h = helper.New(c, p.seal, p.name, argF)
// xdg-dbus-proxy does not need to inherit the environment
h.SetEnv(make([]string, 0))
} else {
@@ -110,15 +111,14 @@ func (p *Proxy) Start(ctx context.Context, output io.Writer, sandbox bool) error
bc.Bind(k, k)
}
- h = helper.MustNewBwrap(bc, toolPath, true, p.seal, argF, nil, nil)
+ h = helper.MustNewBwrap(c, bc, toolPath, true, p.seal, argF, nil, nil)
p.bwrap = bc
}
if output != nil {
- h.Stdout(output).Stderr(output)
+ h.SetStdout(output).SetStderr(output)
}
- c, cancel := context.WithCancelCause(ctx)
- if err := h.Start(c, true); err != nil {
+ if err := h.Start(true); err != nil {
cancel(err)
return err
}