dbus: toggleable xdg-dbus-proxy output

Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
This commit is contained in:
Ophestra Umiker 2024-09-29 15:24:54 +09:00
parent 7e7327ebf8
commit dc59f20d7b
Signed by: cat
SSH Key Fingerprint: SHA256:gQ67O0enBZ7UdZypgtspB2FDM1g3GVw8nX0XSdcFw8Q
2 changed files with 6 additions and 4 deletions

View File

@ -9,7 +9,7 @@ import (
// Start launches the D-Bus proxy and sets up the Wait method. // Start launches the D-Bus proxy and sets up the Wait method.
// ready should be buffered and should only be received from once. // ready should be buffered and should only be received from once.
func (p *Proxy) Start(ready chan error) error { func (p *Proxy) Start(ready chan error, output bool) error {
p.lock.Lock() p.lock.Lock()
defer p.lock.Unlock() defer p.lock.Unlock()
@ -25,8 +25,10 @@ func (p *Proxy) Start(ready chan error) error {
// xdg-dbus-proxy does not need to inherit the environment // xdg-dbus-proxy does not need to inherit the environment
h.Env = []string{} h.Env = []string{}
if output {
h.Stdout = os.Stdout h.Stdout = os.Stdout
h.Stderr = os.Stderr h.Stderr = os.Stderr
}
if err := h.StartNotify(ready); err != nil { if err := h.StartNotify(ready); err != nil {
return err return err
} }

View File

@ -102,7 +102,7 @@ func (tx *appSealTx) startDBus() error {
tx.dbusWait = make(chan struct{}) tx.dbusWait = make(chan struct{})
// background dbus proxy start // background dbus proxy start
if err := tx.dbus.Start(ready); err != nil { if err := tx.dbus.Start(ready, true); err != nil {
return (*StartDBusError)(wrapError(err, "cannot start message bus proxy:", err)) return (*StartDBusError)(wrapError(err, "cannot start message bus proxy:", err))
} }
verbose.Println("starting message bus proxy:", tx.dbus) verbose.Println("starting message bus proxy:", tx.dbus)