diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-02-13 23:15:34 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-02-13 23:34:15 +0900 |
| commit | fe7d208cf76fa6f24bb9d12ba29b5ed61d837ce3 (patch) | |
| tree | cac02af50a13b2078739a8f5a74d219f3b60833d /dbus/proxy.go | |
| parent | 60c287375048b21eab2bd82f1e7d43e36dcfb3a2 (diff) | |
helper: use generic extra files interface
This replaces the pipes object and integrates context into helper process lifecycle.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'dbus/proxy.go')
| -rw-r--r-- | dbus/proxy.go | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/dbus/proxy.go b/dbus/proxy.go index e547855d..77307dc1 100644 --- a/dbus/proxy.go +++ b/dbus/proxy.go @@ -1,6 +1,7 @@ package dbus import ( + "context" "errors" "fmt" "io" @@ -19,29 +20,21 @@ var ProxyName = "xdg-dbus-proxy" type Proxy struct { helper helper.Helper bwrap *bwrap.Config + ctx context.Context + cancel context.CancelCauseFunc name string session [2]string system [2]string + sysP bool seal io.WriterTo lock sync.RWMutex } -func (p *Proxy) Session() [2]string { - return p.session -} - -func (p *Proxy) System() [2]string { - return p.system -} - -func (p *Proxy) Sealed() bool { - p.lock.RLock() - defer p.lock.RUnlock() - - return p.seal != nil -} +func (p *Proxy) Session() [2]string { return p.session } +func (p *Proxy) System() [2]string { return p.system } +func (p *Proxy) Sealed() bool { p.lock.RLock(); defer p.lock.RUnlock(); return p.seal != nil } var ( ErrConfig = errors.New("no configuration to seal") @@ -56,7 +49,7 @@ func (p *Proxy) String() string { defer p.lock.RUnlock() if p.helper != nil { - return p.helper.Unwrap().String() + return p.helper.String() } if p.seal != nil { @@ -96,6 +89,7 @@ func (p *Proxy) Seal(session, system *Config) error { } if system != nil { args = append(args, system.Args(p.system)...) + p.sysP = true } if seal, err := helper.NewCheckedArgs(args); err != nil { return err |
