dbus: configurable xdg-dbus-proxy output
Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
This commit is contained in:
parent
dc59f20d7b
commit
98f9fdb7cc
10
dbus/run.go
10
dbus/run.go
@ -2,14 +2,14 @@ package dbus
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"os"
|
"io"
|
||||||
|
|
||||||
"git.ophivana.moe/cat/fortify/helper"
|
"git.ophivana.moe/cat/fortify/helper"
|
||||||
)
|
)
|
||||||
|
|
||||||
// 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, output bool) error {
|
func (p *Proxy) Start(ready chan error, output io.Writer) error {
|
||||||
p.lock.Lock()
|
p.lock.Lock()
|
||||||
defer p.lock.Unlock()
|
defer p.lock.Unlock()
|
||||||
|
|
||||||
@ -25,9 +25,9 @@ func (p *Proxy) Start(ready chan error, output bool) 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 {
|
if output != nil {
|
||||||
h.Stdout = os.Stdout
|
h.Stdout = output
|
||||||
h.Stderr = os.Stderr
|
h.Stderr = output
|
||||||
}
|
}
|
||||||
if err := h.StartNotify(ready); err != nil {
|
if err := h.StartNotify(ready); err != nil {
|
||||||
return err
|
return err
|
||||||
|
@ -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, true); err != nil {
|
if err := tx.dbus.Start(ready, os.Stderr); 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)
|
||||||
|
Loading…
Reference in New Issue
Block a user